Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block Negative Numbers #41

Open
lucassmacedo opened this issue Nov 30, 2017 · 6 comments
Open

Block Negative Numbers #41

lucassmacedo opened this issue Nov 30, 2017 · 6 comments

Comments

@lucassmacedo
Copy link

Hello! How i block negative numbers?

@rockylhc
Copy link

rockylhc commented Feb 6, 2018

Seems like downgrade to 0.7 is the only way to now

@loomchild
Copy link

You can prevent '-' key from propagating by adding an event handler to your input element, for example like this:

@keydown="$event.key === '-' ? $event.preventDefault() : null"

@ortonomy
Copy link

still relevant in 2021

@jonathanpmartins
Copy link

hey @ortonomy,
Unfortunately I don't think support will come soon. This repo seems to be abandoned! I decided to upgrade this package to be used with Vue3.

Welcome v-money3!

I'm interested to maintain v-money3 for vue 3 and beyond.

Negatives numbers can be blocked using the disable-negative property on the component. Feel free try it out!
Open a issue there if requirements don't meet your expectations.

@brunofunnie
Copy link

You can prevent '-' key from propagating by adding an event handler to your input element, for example like this:

@keydown="$event.key === '-' ? $event.preventDefault() : null"

This can lead to false validation cause you can copy/paste a negative value

@Emmathem
Copy link

You can prevent '-' key from propagating by adding an event handler to your input element, for example like this:

@keydown="$event.key === '-' ? $event.preventDefault() : null"

This can lead to false validation cause you can copy/paste a negative value

I used this and it disallows copy and pasting

@copy.prevent
@paste.prevent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants