Skip to content

Commit dd19de6

Browse files
committed
Fix merge errors
2 parents d4b457a + c602c69 commit dd19de6

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

components/SLDSLookup/Menu/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class Menu extends React.Component {
3939
return this.props.items.filter(this.filter, this).map((c, i) => {
4040
//isActive means it is aria-activedescendant
4141
const isActive = this.props.focusIndex === i + 1 ? true : false;
42-
const id = 'item-'+i;
42+
const id = c.id;
4343
return <Item
4444
key={id}
4545
id={id}

components/SLDSLookup/index.jsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ class SLDSLookup extends React.Component {
2525
super(props);
2626

2727
//Dynamically assign ids to list items to reference for focusing and selecting items
28-
//this.props.items.map((item, index) => { return item.id = 'item-' + index; })
29-
28+
this.modifyItems();
3029

3130
this.state = {
3231
searchTerm: '',
@@ -240,6 +239,14 @@ class SLDSLookup extends React.Component {
240239
);
241240
}
242241

242+
modifyItems () {
243+
this.props.items.map((item, index) => { return item.id = 'item-' + index; })
244+
}
245+
246+
componentWillReceiveProps (newProps) {
247+
this.modifyItems();
248+
}
249+
243250
render(){
244251
let inputClasses = this.state.selectedIndex === null ? 'slds-input':'slds-input slds-hide';
245252
let componentClasses = this.state.selectedIndex === null ? "slds-lookup ignore-react-onclickoutside":"slds-lookup ignore-react-onclickoutside slds-has-selection";

demo/pages/HomePage/ButtonGroupSection.jsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ module.exports = React.createClass( {
2727
return {};
2828
},
2929

30+
handleOnSelect(){
31+
console.log('onSelect triggered');
32+
},
33+
3034
render() {
3135

3236
return (
@@ -47,9 +51,9 @@ module.exports = React.createClass( {
4751
<SLDSButton label='Save' variant='neutral' />
4852

4953
<SLDSDropdownBase
50-
label='More Options'
51-
variant='icon'
52-
iconName='down'
54+
label='More Options'
55+
variant='icon'
56+
iconName='down'
5357
iconVariant='border-filled'
5458
options={[
5559
{label:'A Option Option Super Super Long',value:'A0'},

demo/pages/HomePage/LookupBaseDynamicSection.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ module.exports = React.createClass( {
4949
console.log('New search term: ', newValue);
5050
},
5151

52-
selectItem(item){
53-
console.log(item + ' Selected');
52+
handleItemSelect(item){
53+
console.log(item);
5454
},
5555

5656
render() {
@@ -66,6 +66,7 @@ module.exports = React.createClass( {
6666
onChange={this.onChange}
6767
onItemSelect={this.selectItem}
6868
onNewItem={this.newItem}
69+
onItemSelect={this.handleItemSelect}
6970
onSearchRecords={this.searchRecords}
7071
/>
7172
</div>

0 commit comments

Comments
 (0)