Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/runtime-dom/src/directives/vModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ function castValue(value: string, trim?: boolean, number?: boolean | null) {
return value
}

function activeElement() {
return document.activeElement && document.activeElement.shadowRoot
? document.activeElement.shadowRoot.activeElement
: document.activeElement
}

// We are exporting the v-model runtime directly as vnode hooks so that it can
// be tree-shaken in case v-model is never used.
export const vModelText: ModelDirective<
Expand Down Expand Up @@ -102,7 +108,7 @@ export const vModelText: ModelDirective<
return
}

if (document.activeElement === el && el.type !== 'range') {
if (activeElement() === el && el.type !== 'range') {
// #8546
if (lazy && value === oldValue) {
return
Expand Down