Skip to content

Commit

Permalink
fix(mask): trim input to the length of the mask (if mask is not rever…
Browse files Browse the repository at this point in the history
…se) to avoid regex lock #14558 (#14684)

close #14558
  • Loading branch information
pdanpdan committed Oct 22, 2022
1 parent 781cb1f commit f1cbca2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui/src/components/input/use-mask.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export default function (props, emit, emitValue, inputRef) {

computedMask = mask
computedUnmask = val => {
const unmaskMatch = unmaskMatcher.exec(val)
const unmaskMatch = unmaskMatcher.exec(props.reverseFillMask === true ? val : val.slice(0, mask.length))
if (unmaskMatch !== null) {
val = unmaskMatch.slice(1).join('')
}
Expand Down

0 comments on commit f1cbca2

Please sign in to comment.