Skip to content

Commit

Permalink
revert changes and disable highlight if option is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
luacmartins committed Jan 25, 2023
1 parent 97c48a4 commit 66bc3f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/components/OptionsList/BaseOptionsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,18 +154,20 @@ class BaseOptionsList extends Component {
* @return {Component}
*/
renderItem({item, index, section}) {
const isDisabled = this.props.isDisabled || section.isDisabled;
return (
<OptionRow
option={item}
showTitleTooltip={this.props.showTitleTooltip}
hoverStyle={this.props.optionHoveredStyle}
optionIsFocused={!this.props.disableFocusOptions
&& !isDisabled
&& this.props.focusedIndex === (index + section.indexOffset)}
onSelectRow={this.props.onSelectRow}
isSelected={Boolean(_.find(this.props.selectedOptions, option => option.login === item.login))}
showSelectedState={this.props.canSelectMultipleOptions}
boldStyle={this.props.boldStyle}
isDisabled={this.props.isDisabled || section.isDisabled}
isDisabled={isDisabled}
shouldHaveOptionSeparator={index > 0 && this.props.shouldHaveOptionSeparator}
/>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/OptionsSelector/BaseOptionsSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class BaseOptionsSelector extends Component {
}

const newOptions = this.flattenSections();
const newFocusedIndex = this.props.shouldTextInputAppearBelowOptions ? newOptions.length : this.props.selectedOptions.length;
const newFocusedIndex = this.props.selectedOptions.length;
// eslint-disable-next-line react/no-did-update-set-state
this.setState({
allOptions: newOptions,
Expand Down

0 comments on commit 66bc3f8

Please sign in to comment.