-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
[Feature Request] [VNumberInput] Click event support for increment / decrement buttons #20342
Comments
Is it some kind of server-side validation scenario? |
Hi @J-Sek thanks for picking up this issue and replying. I checked the example you provided and that's really helpful but in my scenario,
That's why I need to handle the increment and decrement button change separately. @J-Sek Please let me know if you need further clarifications |
You probably want to respond to keyboard up/down too right? Would |
@gayanSandamal OK, so it is not the validation, but a "send to the backend" and you want to handle up/down control clicks (not the keybroad actions) without waiting for blur because in the user's mind he is not typing and expects results to be effective immediately. VNumberInput captures clicks on up/down controls, so there is no way to get this behavior. I needed to swap component with rudimentary implementation for this example to work. Please excuse poor debounce.. in real life, you would probably need something better to handle race conditions. |
When I was developing our component I did something similar to what you mentioned above to achieve the expected behaviour |
Thanks a lot @J-Sek I've achieved the expected behaviour by doing something hackie here and it's similar that @KaelWD showed in his comment because I was in a rush to get that done. I will try with your new example because it's more cleaner than what I've done at the moment. Also I will close this issue as it's resolved |
Problem to solve
I tried to used this component to send API requests when on value update by typing and on clicking on the increment and decrement buttons.
According to my use case I wanted to throttle the keyup event separately and emit right after clicking on the increment / decrement buttons.
But as per the current implementation increment / decrement value change fetched under
@update:model-value
Proposed solution
I propose to add something like below where we can separately handle the click event on increment / decrement buttons
@click:increment
/@click:decrement
or one event for bothThe text was updated successfully, but these errors were encountered: