Skip to content

Commit 0f010d3

Browse files
committed
After user selects item, make focus go to remove button on selected item
1 parent 22acaf0 commit 0f010d3

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

components/SLDSLookup/Menu/Item/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class Item extends React.Component {
6767
role="option"
6868
onClick={this.handleClick.bind(this)}
6969
onMouseDown={this.handleClick.bind(this)}>
70-
<Icon name="account" />
70+
<Icon name={this.props.type} />
7171
{ this.boldSearchText(this.props.children.label) }
7272
</a>
7373
</li>

components/SLDSLookup/Menu/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class Menu extends React.Component {
4242
key={c.id}
4343
id={c.id}
4444
index={i}
45+
type={this.props.type}
4546
setFocus={this.props.setFocus}
4647
isActive={isActive}
4748
handleItemFocus={this.handleItemFocus.bind(this)}

components/SLDSLookup/index.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ class SLDSLookup extends React.Component {
4040
if(prevState.selectedIndex && !this.state.selectIndex){
4141
if(this.refs.lookup) React.findDOMNode(this.refs.lookup).focus();
4242
}
43+
else if(!prevState.selectedIndex && this.state.selectedIndex){
44+
if(this.refs.clearSelectedItemButton) React.findDOMNode(this.refs.clearSelectedItemButton).focus();
45+
}
4346
}
4447

4548
//=================================================

0 commit comments

Comments
 (0)