Skip to content

fix(VMaskInput): accept escaped characters in mask#22727

Merged
KaelWD merged 1 commit intomasterfrom
kaelwd/mask-escaping
Mar 19, 2026
Merged

fix(VMaskInput): accept escaped characters in mask#22727
KaelWD merged 1 commit intomasterfrom
kaelwd/mask-escaping

Conversation

@KaelWD
Copy link
Copy Markdown
Member

@KaelWD KaelWD commented Mar 18, 2026

Description

#21925 used isMaskDelimiter which removes all special characters from the input string rather than only those that are actually part of the mask. This PR adds a new mask.isDelimiter function instead that returns true if the character at the provided index is a literal from the mask and false if it is a replaced placeholder.

Markup:

<template>
  <div>
    <v-mask-input
      v-model="modelA"
      label="3 Numbers"
      mask="###"
      placeholder="###"
    />

    <v-mask-input
      v-model="modelB"
      label="# + 3 Numbers"
      mask="\####"
      placeholder="####"
    />
  </div>
</template>

<script setup>
  import { shallowRef } from 'vue'

  const modelA = shallowRef(null)
  const modelB = shallowRef(null)
</script>

@J-Sek J-Sek added T: bug Functionality that does not work as intended/expected C: VMaskInput labels Mar 18, 2026
@KaelWD KaelWD merged commit a5d1116 into master Mar 19, 2026
17 checks passed
@KaelWD KaelWD deleted the kaelwd/mask-escaping branch March 19, 2026 08:15
@KaelWD KaelWD modified the milestones: v3.12.x, v4.0.x Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C: VMaskInput T: bug Functionality that does not work as intended/expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants