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 scrollbar dragged state after release left mouse button #2322

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

LuisLiraC
Copy link
Contributor

Description:
Ensure the correct handling of event_status after checking all possible events. Previously, it was returned before checking Mouse Events, resulting in the scrollbar being dragged continuously from the first click onwards.

Before:

  • The scrollbar is still dragged even after releasing the left button.

ezgif-1-5d725d3d5f

After:

  • The scrollbar is released when the left button is no longer clicked.

ezgif-1-cc0517bf70

widget/src/scrollable.rs Outdated Show resolved Hide resolved
@hecrj
Copy link
Member

hecrj commented Mar 11, 2024

This doesn't seem right. If the contents of the scrollable capture the event; the scrollable should not handle it.

This is most likely caused by some other widget capturing the mouse release when it shouldn't.

Do you have an SSCCE of the issue? Have you implemented a custom widget?

@hecrj hecrj added this to the 0.13 milestone Mar 11, 2024
@hecrj hecrj added bug Something isn't working fix widget labels Mar 11, 2024
Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The real issue here is that the TextEditor is incorrectly capturing mouse::Event::ButtonReleased.

However, I don't think an incorrect widget implementation should break the scrollable; so I changed it a bit to only prioritize the release events even if they are captured.

Thanks!

@hecrj hecrj enabled auto-merge March 11, 2024 09:59
@hecrj hecrj merged commit af8ab81 into iced-rs:master Mar 11, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fix widget
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants