Skip to content

Commit 92101f6

Browse files
committed
minor cleanup
1 parent 0226c17 commit 92101f6

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

components/SLDSLookup/index.jsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,9 @@ class SLDSLookup extends React.Component {
154154
else if((event.keyCode === KEYS.ENTER || event.keyCode === KEYS.SPACE) && this.state.focusIndex !== null){
155155
EventUtil.trapImmediate(event);
156156
//If the focus is on the first fixed Action Item in Menu, click it
157-
if(this.props.header && this.state.focusIndex === 0){
157+
if(this.refs.header && this.state.focusIndex === 0){
158158
// document.getElementById('menuContainer').firstChild.children[0].click();
159-
if(this.refs.header){
160-
React.findDOMNode(this.refs.header).click();
161-
}
159+
React.findDOMNode(this.refs.header).click();
162160
}
163161
//If the focus is on the last fixed Action Item in Menu, click it
164162
else if(this.props.footer && this.state.focusIndex === (this.state.listLength + 1)){
@@ -182,7 +180,7 @@ class SLDSLookup extends React.Component {
182180
}
183181

184182
getHeader(){
185-
if(this.props.header){
183+
if(this.props.headerRenderer){
186184
let headerActive = false;
187185
let isActiveClass = null;
188186
if(this.state.focusIndex === 0){
@@ -192,7 +190,7 @@ class SLDSLookup extends React.Component {
192190
headerActive = false;
193191
isActiveClass = '';
194192
}
195-
const Header = this.props.header;
193+
const Header = this.props.headerRenderer;
196194
return <div className={isActiveClass}>
197195
<Header ref='header' {... this.props}
198196
searchTerm={this.state.searchTerm}
@@ -220,7 +218,6 @@ class SLDSLookup extends React.Component {
220218
setFocus={this.setFocus.bind(this)}
221219
onSelect={this.selectItem.bind(this)}
222220
header={this.getHeader()}
223-
headerProps={this.props.headerProps}
224221
footer={this.props.footer}
225222
/>;
226223
}

demo/pages/HomePage/LookupBaseSection.jsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@ module.exports = React.createClass( {
4545
console.log(item , ' Selected');
4646
},
4747

48-
49-
getHeader(){
50-
return SLDSLookup.DefaultHeader;
51-
},
52-
5348
getFooter(){
5449
return <SLDSLookup.DefaultFooter type='account' />;
5550
},
@@ -74,7 +69,7 @@ module.exports = React.createClass( {
7469
items={items}
7570
label="Account"
7671
type="account"
77-
header={this.getHeader()}
72+
headerRenderer={SLDSLookup.DefaultHeader}
7873
footer={this.getFooter()}
7974
onChange={this.onChange}
8075
onItemSelect={this.selectItem}

0 commit comments

Comments
 (0)