Skip to content

Commit

Permalink
Realign panel after filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
Çağatay Çivici committed Sep 21, 2017
1 parent b1351b9 commit 77e5b11
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/dropdown/Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ export class Dropdown extends Component {
});
}

items = items && this.props.options.map((option, index) => {
items = items && items.map((option, index) => {
return <DropdownItem key={option.label} option={option} template={this.props.itemTemplate} selected={selectedOption === option}
onClick={this.onOptionClick} />;
});
Expand Down Expand Up @@ -424,6 +424,12 @@ export class Dropdown extends Component {
this.container.appendChild(this.panel);
}
}

componentDidUpdate(prevProps, prevState) {
if(this.props.filter) {
this.alignPanel();
}
}

render() {
let className = classNames('ui-dropdown ui-widget ui-state-default ui-corner-all ui-helper-clearfix', this.props.className, {'ui-state-disabled': this.props.disabled});
Expand Down

0 comments on commit 77e5b11

Please sign in to comment.