Skip to content

Commit b973330

Browse files
committed
Fix closing menu bug on action item clicks
1 parent 492222b commit b973330

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

components/SLDSLookup/Menu/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ Menu.propTypes = {
118118
filterWith: React.PropTypes.func,
119119
getListLength: React.PropTypes.func,
120120
setFocus: React.PropTypes.func,
121+
header: React.PropTypes.element,
122+
footer: React.PropTypes.element,
121123
};
122124

123125
Menu.defaultProps = {

demo/pages/HomePage/LookupBaseSection.jsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,25 +43,25 @@ module.exports = React.createClass( {
4343
console.log(item , ' Selected');
4444
},
4545

46-
searchRecords(){
47-
alert('Search Records Clicked');
46+
headerClick(){
47+
console.log('=====> Lookup Header Clicked');
4848
},
4949

50-
newItem(){
51-
alert('New Item Clicked');
50+
footerClick(){
51+
console.log('=====> Lookup Footer Clicked');
5252
},
5353

5454
getHeader(){
5555
return (
56-
<div className="slds-lookup__item" onClick={this.searchRecords} onMouseDown={this.searchRecords}>
57-
<ActionItem item='search' type='account' />
56+
<div className="slds-lookup__item" onClick={this.headerClick} onMouseDown={this.headerClick}>
57+
<ActionItem item='search' type='account' searchTerm={searchTerm} />
5858
</div>
5959
)
6060
},
6161

6262
getFooter(){
6363
return (
64-
<div className="slds-lookup__item" onClick={this.newItem} onMouseDown={this.newItem}>
64+
<div className="slds-lookup__item" onClick={this.footerClick} onMouseDown={this.footerClick}>
6565
<ActionItem item='newItem' type='account' />
6666
</div>
6767
)
@@ -85,7 +85,7 @@ module.exports = React.createClass( {
8585
<div className="slds-p-vertical--large">
8686
<SLDSLookup
8787
items={items}
88-
label="Accounts"
88+
label="Account"
8989
type="account"
9090
header={this.getHeader()}
9191
footer={this.getFooter()}

0 commit comments

Comments
 (0)