Skip to content

Commit

Permalink
Fixed #1360 - When the input filter element is clicked, the panel clo…
Browse files Browse the repository at this point in the history
…ses on DropDown
  • Loading branch information
mertsincan committed Jun 4, 2020
1 parent 34fc584 commit af6745a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/dropdown/Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export class Dropdown extends Component {
this.onOptionClick = this.onOptionClick.bind(this);
this.onFilterInputChange = this.onFilterInputChange.bind(this);
this.onFilterInputKeyDown = this.onFilterInputKeyDown.bind(this);
this.onPanelClick = this.onPanelClick.bind(this);
this.clear = this.clear.bind(this);
}

Expand Down Expand Up @@ -154,6 +155,10 @@ export class Dropdown extends Component {
}
}

onPanelClick(event) {
event.stopPropagation();
}

onUpKey(event) {
if (this.props.options) {
let selectedItemIndex = this.findOptionIndex(this.props.value);
Expand Down Expand Up @@ -743,7 +748,7 @@ export class Dropdown extends Component {
{dropdownIcon}
<DropdownPanel ref={(el) => this.panel = el} appendTo={this.props.appendTo}
panelStyle={this.props.panelStyle} panelClassName={this.props.panelClassName}
scrollHeight={this.props.scrollHeight} filter={filterElement}>
scrollHeight={this.props.scrollHeight} filter={filterElement} onClick={this.onPanelClick}>
{items}
</DropdownPanel>
</div>
Expand Down

0 comments on commit af6745a

Please sign in to comment.