Skip to content

Commit

Permalink
use DOM API instead of attribute for "selected" (#1576)
Browse files Browse the repository at this point in the history
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 and jhchen committed Jul 10, 2017
1 parent ca33f32 commit dbfb0af
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 dbfb0af

Please sign in to comment.