Skip to content

Commit 01ce6e7

Browse files
committed
prevent negative value paste
1 parent 2bbdb94 commit 01ce6e7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ export function updateValue(el: CustomInputElement, vnode: VNode | null, { emit
102102

103103
// check value with in range max and min value
104104
if (clean) {
105-
if (options.max && Number(unmasked) > options.max) {
105+
if (Number(options.max) === options.max && Number(unmasked) > options.max) {
106106
masked = number.format(options.max)
107107
unmasked = number.unformat(options.max)
108-
} else if (options.min && Number(unmasked) < options.min) {
108+
} else if (Number(options.min) === options.min && Number(unmasked) < options.min) {
109109
masked = number.format(options.min)
110110
unmasked = number.unformat(options.min)
111111
}

0 commit comments

Comments
 (0)