bevyengine / bevyengine/bevy

` bevy_input_focus`: Rules for auto-navigation between overlapping focusable areas

Open
#22,528 0 comments 0 reactions 0 assignees View on GitHub
A-UI C-Feature D-Modest S-Ready-For-Implementation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## What problem does this solve or what need does it fill?

Autonavigation needs clear rules for dealing with overlapping focusable areas.

Made a quick diagram with some random cases:

![Image](https://github.com/user-attachments/assets/4d6cfd62-3501-4042-b6b2-a8de32ca839a)

The green area is the current input focus and we're interested in which areas would get visited in which order on the downwards path to the red area.

## What solution would you like?

Apply two rules for auto navigation when searching for navigable focus areas:
1. Ignore focus areas overlapping the current focus area.
2. If two focus areas are overlapping, ignore the one underneath.

Ideally it should be configurable though, there are cases where allowing auto navigation between intersecting areas is desirable. For example, navigating a stack of folders:

![Image](https://github.com/user-attachments/assets/e1344145-5c24-4c59-938f-f6269dd4113b)

This could be implemented without intersected focus areas though by using smaller nodes for the focus areas:

![Image](https://github.com/user-attachments/assets/8dd8e653-23b4-491f-b349-4b6ffb3b02f5)

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.