Browse Source

Revert "fix select multiple first option auto-selected in Chrome/FF (fix #3852)"

This reverts commit f9bef75a34.
dev
Evan You 8 years ago
parent
commit
d0cfd549ba
  1. 11
      src/platforms/web/runtime/modules/attrs.js

11
src/platforms/web/runtime/modules/attrs.js

@ -68,15 +68,6 @@ function setAttr (el: Element, key: string, value: any) {
}
export default {
create: function initAttrs (_: VNodeWithData, vnode: VNodeWithData) {
updateAttrs(_, vnode)
// #3852: if the "multiple" attribute is added to a <select> element
// when the children options have already been appended, Chrome/Firefox
// auto-selects the first option.
const el: any = vnode.elm
if (vnode.tag === 'select' && el.multiple) {
el.options[0] && (el.options[0].selected = false)
}
},
create: updateAttrs,
update: updateAttrs
}

Loading…
Cancel
Save