Skip to content

Conversation

Maksych
Copy link

@Maksych Maksych commented Sep 21, 2025

Objective

  • Scroll list with clickable items on mobile.

Solution

  • Add dragged field to pointer click and release.

Testing

  • Tested via example (examples/ui/mobile_list.rs)

Showcase

An example of use is given in examples/ui/mobile_list.rs

@Copilot Copilot AI review requested due to automatic review settings September 21, 2025 07:54
Copy link
Contributor

Welcome, new contributor!

Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds a dragged field to pointer click and release events to enable better mobile UI handling by distinguishing between clicks and scroll gestures. This allows scrollable lists with clickable items to work properly on mobile devices.

  • Added dragged boolean field to Click and Release structs
  • Updated event generation logic to track dragging state during pointer interactions
  • Provided example demonstrating mobile scrollable list implementation

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
crates/bevy_picking/src/events.rs Adds dragged field to Click and Release events and implements dragging detection
examples/ui/mobile_list.rs New example demonstrating mobile scrollable list with clickable items
Cargo.toml Registers the new mobile_list example

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Maksych
Copy link
Author

Maksych commented Sep 21, 2025

Resolves #18923

Copy link
Contributor

The generated examples/README.md is out of sync with the example metadata in Cargo.toml or the example readme template. Please run cargo run -p build-templated-pages -- update examples to update it, and commit the file change.

@Maksych Maksych changed the title 18923: add dragged field to pointer click and release Add dragged field to pointer click and release Sep 21, 2025
@alice-i-cecile alice-i-cecile added this to the 0.18 milestone Sep 21, 2025
@alice-i-cecile alice-i-cecile added C-Feature A new feature, making something new possible A-UI Graphical user interfaces, styles, layouts, and widgets S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Sep 21, 2025
@NthTensor NthTensor self-requested a review September 22, 2025 18:04
Copy link
Contributor

@NthTensor NthTensor left a comment

Choose a reason for hiding this comment

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

I'm fine with this as it relates to the pointer event dispatch logic. Will leave it to others to say if this is how we prefer to resolve #18923.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-UI Graphical user interfaces, styles, layouts, and widgets C-Feature A new feature, making something new possible S-Needs-Review Needs reviewer attention (from anyone!) to move forward

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants