Skip to content

Commit

Permalink
Hidden select should always be rendered
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Jan 10, 2019
1 parent 973c906 commit c6c9c04
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions src/components/dropdown/Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,22 +506,19 @@ export class Dropdown extends Component {
}

renderHiddenSelect() {
if(this.props.autoWidth) {
let placeHolderOption = <option value="">{this.props.placeholder}</option>;
let options = this.props.options && this.props.options.map((option, i) => {
return <option key={this.getOptionKey(option)} value={option.value}>{this.getOptionLabel(option)}</option>;
});
let placeHolderOption = <option value="">{this.props.placeholder}</option>;
let options = this.props.options && this.props.options.map((option, i) => {
return <option key={this.getOptionKey(option)} value={option.value}>{this.getOptionLabel(option)}</option>;
});

return (<div className="p-hidden-accessible">
<select ref={(el) => this.nativeSelect = el} id="xxx" required={this.props.required} tabIndex="-1" aria-hidden="true">
{placeHolderOption}
{options}
</select>
</div>);
}
else {
return null;
}
return (
<div className="p-hidden-accessible">
<select ref={(el) => this.nativeSelect = el} id="xxx" required={this.props.required} tabIndex="-1" aria-hidden="true">
{placeHolderOption}
{options}
</select>
</div>
);
}

renderKeyboardHelper() {
Expand Down

0 comments on commit c6c9c04

Please sign in to comment.