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

Fix slider update on readout text change #3568

Merged
merged 1 commit into from
Aug 26, 2022

Conversation

jtpio
Copy link
Member

@jtpio jtpio commented Aug 26, 2022

Description

In ipywidgets 7 it was possible to edit the readout of a slider, press Enter and the position of the slider would be updated according to the new value:

slider-update-7.mp4

This does not seem possible anymore with the latest ipywidgets release (8.0.1 at the time of writing).

Changes

Remove { updated_view: this } from the options when the change comes from updating the text.

Before

slider-update.mp4

After

slider-update-fixed.mp4

@github-actions
Copy link

Binder 👈 Launch a binder notebook on branch jtpio/ipywidgets/fix-slider

@jtpio
Copy link
Member Author

jtpio commented Aug 26, 2022

#2712 (comment) might give some context on the origin of updated_view:

Changed some of the function signatures to accept the updated_view attribute. This is now used to validate whether the slider should update its value when the updateSliderValue callback is invoked. This now enables smooth animations with no lags

Dropping it when the update comes from handleTextChange like in this PR appears to be fine, as the update is triggered when pressing Enter.

@jtpio jtpio added the bug label Aug 26, 2022
@jtpio jtpio added this to the Patch release milestone Aug 26, 2022
@jasongrout jasongrout merged commit e722a0d into jupyter-widgets:master Aug 26, 2022
@jasongrout
Copy link
Member

Thanks!

@jtpio jtpio deleted the fix-slider branch August 26, 2022 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants