bevy/crates/bevy_input_focus
Erick Z 4da420cc4c
Fixing AutoFocus not working if it's spawn before Startup (#19618)
# Objective

- `AutoFocus` component does seem to work with the `set_initial_focus`
that was running in `Startup`.
- If an element is spawn during `PreStartup` or during
`OnEnter(SomeState)` that happens before `Startup`, the focus is
overridden by `set_initial_focus` which sets the focus to the primary
window.


## Solution

- `set_initial_focus` only sets the focus to the `PrimaryWindow` if no
other focus is set.

- *Note*: `cargo test --package bevy_input_focus` was not working, so
some changes are related to that.

## Testing

- `cargo test --package bevy_input_focus`: OK
- `cargo run --package ci`: OK
2025-06-13 17:15:47 +00:00
..
src Fixing AutoFocus not working if it's spawn before Startup (#19618) 2025-06-13 17:15:47 +00:00
Cargo.toml Fixing AutoFocus not working if it's spawn before Startup (#19618) 2025-06-13 17:15:47 +00:00
LICENSE-APACHE Cleanup publish process (#17728) 2025-02-09 17:46:19 +00:00
LICENSE-MIT Cleanup publish process (#17728) 2025-02-09 17:46:19 +00:00
README.md

Bevy Input Focus

License Crates.io Downloads Docs Discord