FeathersNumberInput text input node can be left with zero width when an unrelated node is hovered
Maintainers usually reply within 2 days
@collapsedonion is already working on this.
Since Oct 28, 2026.
Assessment
- Difficulty
- 3/5
- Estimated time
- Half a day
- Newbie friendliness
- 68/100
Research direction
Start by locating the Bevy Feathers number input implementation and its UI layout tests; the issue does not name specific files. Reproduce the two side-by-side inputs and hover one, then inspect why the other input's text node gets zero width when its container has max_width but no explicit width. Done when the non-hovered input retains a visible text area and a regression test covers the layout.
Written by the indexing model from the issue text.
Description
Bevy version and features
bevy = { version = "0.20.0", features = ["bevy_feathers"] }
What you did
Two FeathersNumberInputs side by side, each in its own Baseline row inside a column inside a shared row, then hover one of them.
use bevy::{
feathers::{
FeathersPlugins,
controls::{
FeathersNumberInput, FeathersTextInput, HardLimit, NumberInputPrecision,
NumberInputStep, NumberInputValue, SoftLimit,
},
dark_theme::create_dark_theme,
theme::{ThemeBackgroundColor, UiTheme},
tokens,
},
prelude::*,
ui::ComputedNode,
};
#[derive(Component, Clone, Copy, Default)]
struct Left;
#[derive(Component, Clone, Copy, Default)]
struct Right;
#[derive(SceneComponent, Clone, Default)]
struct ReproNumberInput;
impl ReproNumberInput {
fn scene() -> impl Scene {
bsn! {
@FeathersNumberInput
Node {
// width: px(100), // This fixes the issue
max_width: px(100),
}
NumberInputValue::F32(1.0)
NumberInputPrecision(1)
NumberInputStep(0.1)
SoftLimit::f32(0.1..=3.0)
HardLimit::f32(0.1..=3.0)
}
}
}
fn main() {
App::new()
.add_plugins((
DefaultPlugins.set(WindowPlugin {
primary_window: Some(Window {
resolution: (400, 200).into(),
..default()
}),
..default()
}),
FeathersPlugins,
))
.insert_resource(UiTheme(create_dark_theme()))
.add_systems(Startup, setup)
.add_systems(Update, drive)
.run();
}
fn setup(mut commands: Commands) {
commands.spawn_scene_list(bsn_list! {
Camera2d
IsDefaultUiCamera
--
Node {
width: percent(100),
height: percent(100),
align_items: AlignItems::Center,
justify_content: JustifyContent::Center,
}
ThemeBackgroundColor(tokens::WINDOW_BG)
Children [
Node {
flex_direction: FlexDirection::Column,
justify_content: JustifyContent::FlexStart,
flex_grow: 1.0,
height: percent(100),
}
Children [
Node {
flex_direction: FlexDirection::Row,
justify_content: JustifyContent::FlexStart,
align_items: AlignItems::Baseline,
}
Children [
Node {
width: px(18),
min_width: px(18),
height: px(18),
}
--
@ReproNumberInput
Left
]
]
--
Node {
flex_direction: FlexDirection::Column,
justify_content: JustifyContent::FlexStart,
flex_grow: 1.0,
height: percent(100),
}
Children [
Node {
flex_direction: FlexDirection::Row,
justify_content: JustifyContent::FlexStart,
align_items: AlignItems::Baseline,
}
Children [
Node {
width: px(18),
min_width: px(18),
height: px(18),
}
--
@ReproNumberInput
Right
]
]
]
});
}
fn text_node_of(
root: Entity,
children: &Query<&Children>,
is_text_input: &Query<(), With<FeathersTextInput>>,
) -> Option<Entity> {
children
.iter_descendants(root)
.find(|e| is_text_input.contains(*e))
}
fn text_width(
root: Entity,
children: &Query<&Children>,
is_text_input: &Query<(), With<FeathersTextInput>>,
nodes: &Query<&ComputedNode>,
) -> Option<f32> {
let text = text_node_of(root, children, is_text_input)?;
nodes.get(text).ok().map(|n| n.size().x)
}
fn drive(
mut verdict: Local<bool>,
q_left: Query<Entity, With<Left>>,
q_right: Query<Entity, With<Right>>,
q_children: Query<&Children>,
q_is_text_input: Query<(), With<FeathersTextInput>>,
q_nodes: Query<&ComputedNode>,
) {
let Ok(left) = q_left.single() else { return };
let Ok(right) = q_right.single() else { return };
let left_width = text_width(left, &q_children, &q_is_text_input, &q_nodes);
let right_width = text_width(right, &q_children, &q_is_text_input, &q_nodes);
if right_width == Some(0.0) && left_width == Some(0.0) {
return;
}
if !*verdict && (right_width == Some(0.0) || left_width == Some(0.0)) {
info!("left text width = {left_width:?}, right text width = {right_width:?}");
*verdict = true;
}
}
What went wrong
The other (non-hovered) FeathersNumberInput renders as a blank grey rectangle. Its text node's ComputedNode::size().x becomes 0 while its height stays non-zero, so only the containers background shows through.
Output from the above repro when hovering over the left input:
left text width = Some(200.0), right text width = Some(0.0)
Additional information
AI was used to help reduce the reproduction to its minimal form.
Initial screenshot:
Screenshot after hovering over leftmost FeathersNumberInput:
Adding an explicit width: px(100) to the FeathersNumberInput Node fixes the issue.
- Dominant language
- Rust
- Stars
- 49.8k
- Forks
- 5.1k
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 136
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bevyengine/bevy
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
bevyengine/bevy#26642 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
bevyengine/bevy#26641 ·
Maintainers usually reply within 2 days
-
A-Animation AI-Assisted C-Bug D-Trivial S-Needs-Triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bevyengine/bevy#26637 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bevyengine/bevy#26635 ·
Maintainers usually reply within 2 days
-
Feathers checkbox outline should have flex_shrink: 0Possibly taken @Tatsuya0330 claimed this today. OpenC-Bug S-Needs-Triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
bevyengine/bevy#26630 ·
Maintainers usually reply within 2 days
Similar issues
-
go good first issue test
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 2 days
-
bug triaged tui ux wontfix
Difficulty 2/5 Half a day Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day