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

Ensure move events are only sent between start/end #1082

Merged
merged 2 commits into from
Jun 26, 2023
Merged

Conversation

rodja
Copy link
Member

@rodja rodja commented Jun 26, 2023

This PR fixes a bug in ui.joystick where sometimes a on_move is called after on_end.

Reproduction:

ui.joystick(color='blue', size=50,
            on_move=lambda e: coordinates.set_text(f"{e.x:.3f}, {e.y:.3f}"),
            on_end=lambda _: coordinates.set_text('0, 0'))
coordinates = ui.label('0, 0')

When releasing the mouse while dragging, the text is often not set back to 0, 0.

@rodja rodja added the bug Something isn't working label Jun 26, 2023
@rodja rodja added this to the 1.2.23 milestone Jun 26, 2023
@falkoschindler falkoschindler changed the title ensure move events are only send between start/end Ensure move events are only sent between start/end Jun 26, 2023
@falkoschindler falkoschindler merged commit 7e890d2 into main Jun 26, 2023
@falkoschindler falkoschindler deleted the joystick_fix branch June 26, 2023 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants