-
Notifications
You must be signed in to change notification settings - Fork 949
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
Revamp event handling in text boxes and add continuous_update option #1545
Conversation
…e with sliders. This also is needed to make the spinners in the new number inputs work appropriately, especially with floating point numbers.
CC @mpacer |
@mpacer (or anyone), if you have a better name than "continuous_update", I'm all ears... |
Deprecate the Text on_submit handler.
Basically, if you typed ‘3.’, it would parse the number as 3 and reset the value, so you could never type the decimal. Also, fixed some issues with min, max, and step being set, especially if they were undefined.
For floats, a step of None means any step is allowed.
@mpacer, I think this is ready to go. Would you like to give it a spin before merging, or would it be easier to merge and spin off another beta for you to take a look at? |
I can give it a spin before the end of the day :) thanks for getting to this so quickly! |
I think it would help to include in the docstrings what the default behaviour is (i.e., when |
Also it'd be good to have an example in the docs of both kinds of behaviour. Probably in the Widgets Event section. This shouldn't need backend connections as far as I can tell so it should explain the behaviour nicely in the docs with two appropriate examples. Also, you probably want to remove the Special Events |
I'm entirely relying on the browser events, hoping that they Do The Right Thing [1]. Does it have the behavior in other browsers too? [1] Perhaps too optimistic? Our hopes have been dashed many times before... |
Oh, the issue there is that when you delete, it recognizes it's not a number, so it's patiently waiting for you to type something that is a number. |
(that's also why it resets when you click out - if the value is not valid, it resets to the previous value) |
Right - doc changes coming up... |
What if we put in a placeholder like "Type a number" or something? That would show if you deleted everything in the box. Would that be enough of a hint? |
@mpacer, I updated the docs. Thoughts? |
Merging - @mpacer, feel free to open another issue if you see something we missed. |
Also, specialize those inputs to type number, and add a step option.
I default continuous_update to False for the textboxes because I figured if people were typing, that's typically what is wanted.
FIxes #584 and #1401.