gyscos / gyscos/cursive

Improve `View::take_focus` behaviour with mouse events.

Open
#460 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
4.8k
Forks
270
Avg merge
5d 19h
Merged PRs (30d)
2

Description

When `take_focus` is caused by a mouse event, `source = Direction::none()` may not be enough to decide whether to take the focus or now.

Example: a `LinearLayout` with two children, only one of them focusable. If a mouse click falls on the non-focusable child, should the LinearLayout take focus? And transmit it to the other, focusable child?

One solution for that is to add a new type of absolute direction: maybe `Absolute::Target(Vec2)`, used for focus caused by mouse events. Or maybe give `Absolute::None` an `Option` target?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.