flame-engine / flame-engine/flame
Continue to receive drag (and eventually hover) events after the pointer has left the component
- Dominant language
- Dart
- Stars
- 10.8k
- Forks
- 1k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 21
Description
# What could be improved
Currently only event updates that happen still within the component bounds are propagated. Even if a drag (or hover) started within the component, once the pointer leaves, it stops receiving updates.
We should provide an option for the user to configure this; for example:
```
class FooComponent extends PositionComponent with DragCallbacks {
// false by default; or some other name like this
@override
bool get continueReceivingDragCallbacks => true;
}
```
Same for the hovers.
This should actually be true by default as this use case is much more common.
# Why should this be improved
Similar rationale of https://github.com/flame-engine/flame/issues/2718
Also if you are dragging a component around too fast, it "loses track" (i.e. if your mouse displacement is bigger than the component's size).
# Any risks?
No.
Contributor guide
Assessment
This issue has not been assessed yet.