From 951f629d0c4297555183bee6fd3f88853c2ceb9d Mon Sep 17 00:00:00 2001 From: Sarah Leventhal Date: Tue, 13 Jun 2023 11:05:06 -0400 Subject: [PATCH] fix(core.js): allow native handling of composition events when no mask is passed --- src/core.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core.js b/src/core.js index bcb8c0a..14d9130 100644 --- a/src/core.js +++ b/src/core.js @@ -55,6 +55,7 @@ export function getInputElement(el) { */ export function inputHandler(event) { const { target, detail, inputType } = event + const { config } = target[CONFIG_KEY] // We dont need to run this method on the event we emit (prevent event loop) if (detail?.facade) { @@ -67,7 +68,7 @@ export function inputHandler(event) { // Ignore input events related to composition, specific composition // events will handle updating the input after text is composed - if (['insertCompositionText', 'insertFromComposition'].includes(inputType)) { + if (['insertCompositionText', 'insertFromComposition'].includes(inputType) && config.mask) { return false } @@ -148,7 +149,7 @@ export function updateValue(el, vnode, { emit = true, force = false } = {}, even let currentValue = vnode?.data?.model?.value || el.value // manipulating input value while text is being composed can lead to inputs being duplicated - if (isComposing) { + if (config.mask && isComposing) { return }