Skip to content

Commit

Permalink
fix(core.js): allow native handling of composition events when no mas…
Browse files Browse the repository at this point in the history
…k is passed
  • Loading branch information
Sarah Leventhal committed Jun 13, 2023
1 parent fd20542 commit 951f629
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
}

Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 951f629

Please sign in to comment.