diff --git a/src/platforms/web/runtime/modules/dom-props.js b/src/platforms/web/runtime/modules/dom-props.js index 52235850d7c..c6ba3d0e924 100644 --- a/src/platforms/web/runtime/modules/dom-props.js +++ b/src/platforms/web/runtime/modules/dom-props.js @@ -41,7 +41,7 @@ function updateDOMProps (oldVnode: VNodeWithData, vnode: VNodeWithData) { elm._value = cur // avoid resetting cursor position when value is the same const strCur = isUndef(cur) ? '' : String(cur) - if (shouldUpdateValue(elm, vnode, strCur)) { + if (shouldUpdateValue(elm, strCur)) { elm.value = strCur } } else { @@ -53,13 +53,9 @@ function updateDOMProps (oldVnode: VNodeWithData, vnode: VNodeWithData) { // check platforms/web/util/attrs.js acceptValue type acceptValueElm = HTMLInputElement | HTMLSelectElement | HTMLOptionElement; -function shouldUpdateValue ( - elm: acceptValueElm, - vnode: VNodeWithData, - checkVal: string -): boolean { +function shouldUpdateValue (elm: acceptValueElm, checkVal: string): boolean { return (!elm.composing && ( - vnode.tag === 'option' || + elm.tagName === 'OPTION' || isDirty(elm, checkVal) || isInputChanged(elm, checkVal) ))