We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d7d85fd + 5493b18 commit 12a8305Copy full SHA for 12a8305
components/SLDSLookup/index.jsx
@@ -47,10 +47,10 @@ class SLDSLookup extends React.Component {
47
48
componentDidUpdate(prevProps, prevState){
49
let lookup = this.props.type + 'Lookup';
50
- if(prevState.selectedIndex && !this.state.selectIndex){
+ if(!isNaN(parseInt(prevState.selectedIndex)) && isNaN(parseInt(this.state.selectedIndex))){
51
if(this.refs[lookup]) React.findDOMNode(this.refs[lookup]).focus();
52
}
53
- else if(!prevState.selectedIndex && this.state.selectedIndex){
+ else if(isNaN(parseInt(prevState.selectedIndex)) && !isNaN(parseInt(this.state.selectedIndex))){
54
let selectedItem = 'pill-' + this.state.selectedIndex;
55
if(this.refs[selectedItem]) React.findDOMNode(this.refs[selectedItem]).focus();
56
0 commit comments