-
Notifications
You must be signed in to change notification settings - Fork 945
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
Deprecation of widgets.Text.on_submit #2446
Comments
@janfreyberg Did you ever determine how to resolve this? Or did you just stick with |
I'm still using on_submit (and suppressing the warning). I haven't tried switching to |
Thanks for the response. Yes -- I encountered the same issue now as you did in 2019. Will just |
I, too, had to suppress the deprecation warning because I could find no working way to use observe to detect an 'enter' keystroke in an input field. |
Hey I'm a little late to the party but this seems to work (assuming latest updates to python, ipywidgets)import ipywidgets as widgets def execute(s): input2 = widgets.Text( input2.observe(execute,'value') |
Hi everyone,
I'm using the Text widget in a few of my projects. I often employ the
on_submit
method on them to register a callback that gets called when the user hits enter while the cursor is inside the text box.There's a deprecation warning on
on_submit
which recommends usingwidget.observe(callback, 'value')
withcontinuous_update=False
instead.Having tried to make this switch, I noticed that these aren't exactly equivalent, since widgets.Text.observe also triggers when the cursor leaves the Textbox. In my case, that's undesirable - I'd like for users to explicitly be able to submit a text field by hitting enter.
Is this deprecation of on_submit still planned? Will there be a way to replicate the previous behaviour?
Thanks very much!
Jan
The text was updated successfully, but these errors were encountered: