Skip to content

don't filter dragged entity out of DragEnter events #19179

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions crates/bevy_picking/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,11 +527,7 @@ pub fn pointer_events(
for button in PointerButton::iter() {
let state = pointer_state.get_mut(pointer_id, button);

for drag_target in state
.dragging
.keys()
.filter(|&&drag_target| hovered_entity != drag_target)
{
for drag_target in state.dragging.keys() {
state.dragging_over.insert(hovered_entity, hit.clone());
let drag_enter_event = Pointer::new(
pointer_id,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: DragEnter now includes the dragged entity
pull_requests: [19179]
---

DragEnter events are now triggered when entering any entity, even the originally dragged one. This makes the behavior more consistent.

The old behavior can be achieved by checking if trigger.target != trigger.dragged