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

Add prop to enable/disable resetting erased values (called debouncing?) #35

Open
taeh98 opened this issue Feb 11, 2021 · 4 comments
Open
Labels
enhancement New feature or request

Comments

@taeh98
Copy link
Contributor

taeh98 commented Feb 11, 2021

We have talked a little previously about how after you erase a value in a spinner (with the keyboard), after a certain amount of time the value is restored. I think you called it debouncing or said it was after a debounce period, but I'm not totally sure about its details. I'm having behaviour similar to this with some input spinners, particularly those with min values > 0. The behaviour is a little buggy, though that (or the behaviour appearing at all) might be because of my dev environment. I was wondering (assuming this behaviour is indeed in place) if you could please add a prop to enable or disable it? This prop would control if after someone erases a value it restores it after a certain amount of time or will leave it as undefined. It would obviously only be needed if this behaviour is indeed currently implemented by the package.

@marcocesarato marcocesarato added the enhancement New feature or request label Feb 11, 2021
@marcocesarato
Copy link
Owner

marcocesarato commented Feb 13, 2021

Hi, could you add an example? Because it doesn't happen to me that the value is restored when erased.
Debounce occurs when you frequently update a value so that you set a time interval in which you decide to not update the value until this time interval has elapsed.

@taeh98
Copy link
Contributor Author

taeh98 commented Feb 13, 2021

Hi, could you add an example? Because it doesn't happen to me that the value is restored when erased.

It's quite hard to because I don't know how to screen record my phone. When I have an spinner where min > 0, even if the number has multiple digits, pressing the backspace button erases the whole value (instead of only the last digit) after a short pause. And sometimes after erasing it and putting in a new value, it will change it to the min value. More rarely, after erasing the value the min value is restored. This all only really happens when min > 0 for some reason. it might be to do with how values/mins are compared. If you'd like to see it I'd be happy to send you an APK file to see what I mean!

@taeh98
Copy link
Contributor Author

taeh98 commented Feb 14, 2021

Hi, could you add an example? Because it doesn't happen to me that the value is restored when erased.

I've worked out how to screen record my phone so now can show you an example. For the spinner with which I'm interacting, the min is 10 and the max is 100. The value is initially undefined - even though it's showing it as 10 instead of the placeholder. This is the first problem you can see in the recording.

When the value is 10 and I press backspace once, you can see the value change from 10 to 1, then back to 10, then to undefined (i.e. empty and showing the placeholder). When I then type in 20 and erase it, it jumps from 20 to 2 to 10 to undefined again. Each time I only pressed backspace once for these multiple changes to the value to happen. In these two examples, after pressing the backspace when the value is 10, the value should stay as 1. After pressing backspace when the value is 20, it should stay as 2. This is the second problem.

You can see me changing the value up from 0.1 since undefined is correlated with 0 in your implementation. When I tap the plus button it works, increasing to 0.2, 0.3, etc. But when I hold the plus button, it erases the value and turns into undefined again. This is the third problem.

6503173317.mp4

@denisvely
Copy link

Any updates on this one?

I also have a problem with negative numbers.

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

No branches or pull requests

3 participants