parentSuspense?: SuspenseBoundary | null,
unmountChildren?: UnmountChildrenFn
): void
+ forcePatchProp?(el: HostElement, key: string): boolean
insert(el: HostNode, parent: HostElement, anchor?: HostNode | null): void
remove(el: HostNode): void
createElement(
insert: hostInsert,
remove: hostRemove,
patchProp: hostPatchProp,
+ forcePatchProp: hostForcePatchProp,
createElement: hostCreateElement,
createText: hostCreateText,
createComment: hostCreateComment,
const key = propsToUpdate[i]
const prev = oldProps[key]
const next = newProps[key]
- if (prev !== next) {
+ if (
+ next !== prev ||
+ (hostForcePatchProp && hostForcePatchProp(el, key))
+ ) {
hostPatchProp(
el,
key,
if (isReservedProp(key)) continue
const next = newProps[key]
const prev = oldProps[key]
- if (next !== prev) {
+ if (
+ next !== prev ||
+ (hostForcePatchProp && hostForcePatchProp(el, key))
+ ) {
hostPatchProp(
el,
key,
addEventListener(el, 'change', onCompositionEnd)
}
},
- beforeUpdate(el, { value, oldValue, modifiers: { trim, number } }, vnode) {
+ beforeUpdate(el, { value, modifiers: { trim, number } }, vnode) {
el._assign = getModelAssigner(vnode)
- if (value === oldValue) {
- return
- }
if (document.activeElement === el) {
if (trim && el.value.trim() === value) {
return
RootHydrateFunction
} from '@vue/runtime-core'
import { nodeOps } from './nodeOps'
-import { patchProp } from './patchProp'
+import { patchProp, forcePatchProp } from './patchProp'
// Importing from the compiler, will be tree-shaken in prod
import { isFunction, isString, isHTMLTag, isSVGTag, extend } from '@vue/shared'
}
}
-const rendererOptions = extend({ patchProp }, nodeOps)
+const rendererOptions = extend({ patchProp, forcePatchProp }, nodeOps)
// lazy create the renderer - this makes core renderer logic tree-shakable
// in case the user only imports reactivity utilities from Vue.
const nativeOnRE = /^on[a-z]/
-export const patchProp: RendererOptions<Node, Element>['patchProp'] = (
+type DOMRendererOptions = RendererOptions<Node, Element>
+
+export const forcePatchProp: DOMRendererOptions['forcePatchProp'] = (_, key) =>
+ key === 'value'
+
+export const patchProp: DOMRendererOptions['patchProp'] = (
el,
key,
prevValue,