Skip to content

Commit

Permalink
use DOM API instead of attribute for "selected"
Browse files Browse the repository at this point in the history
https://developer.mozilla.org/en-US/docs/Web/API/HTMLOptionElement

The Option element exposes a "selected" getter that works even when the "selected" attribute is not set, such as when the element is created by React or manipulated. Fixes react-quill#175.
  • Loading branch information
alexkrolick authored Jul 9, 2017
1 parent eb4235a commit 83bc691
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui/picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Picker {
[].slice.call(this.select.options).forEach((option) => {
let item = this.buildItem(option);
options.appendChild(item);
if (option.hasAttribute('selected')) {
if (option.selected === true) {
this.selectItem(item);
}
});
Expand Down

0 comments on commit 83bc691

Please sign in to comment.