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 event when number input on gr.Slider is released #3443

Closed
1 task done
space-nuko opened this issue Mar 11, 2023 · 4 comments · Fixed by #3589
Closed
1 task done

Add event when number input on gr.Slider is released #3443

space-nuko opened this issue Mar 11, 2023 · 4 comments · Fixed by #3589
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@space-nuko
Copy link
Contributor

space-nuko commented Mar 11, 2023

  • I have searched to see if a similar issue already exists.

Is your feature request related to a problem? Please describe.
After #3353 there's an event for when the user releases the mouse from the slider bar. This is good, but it does not apply to the number input inside the slider. If the mouse is held down on one of the arrows inside there, only the regular change event will be fired, still causing massive performance issues depending on the event handlers

Describe the solution you'd like
The release event should apply to the number input on the slider just like the slider itself

Additional context
#3204

@anapnoe
Copy link

anapnoe commented Mar 12, 2023

This is a must feature that affects performance for all applications and can't be patched only for the slider the issue is present on all input fields, only the drop down utilize the on change event the current fix provided uses 3 event listeners to dispatch a native change event why to re-invent the wheel please provide a solid solution, all components should be able to dispatch an on change event this is a core issue if solved will leverage the quality of gradio's framework overall

@abidlabs
Copy link
Member

abidlabs commented Mar 12, 2023

Makes sense to me, @freddyaboulton can we use the same event here?

@freddyaboulton
Copy link
Collaborator

Thanks for filing @space-nuko !

Yea I think we can make it so that the release event is dispatched when the user lets go of one of the arrows in the type-able number field.

@anapnoe
Copy link

anapnoe commented Mar 20, 2023

slider_proto.mp4

this is an idea of how I think it should be implemented visual feedback is important when the slider is dragged or when the input buttons are pressed, by default release event will not dispatch visual changes to the input field and vice versa pressing the input field buttons will not update the slider bar until the mouse button is released, so it would be nice to have visual feedback on the value changed. The green dot on the upper left shows when the event is dispatched, I hope this is of some help best regards

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

Successfully merging a pull request may close this issue.

4 participants