Skip to content

Feathers text input widget#23645

Merged
alice-i-cecile merged 14 commits intobevyengine:mainfrom
viridia:feathers_text_input
Apr 7, 2026
Merged

Feathers text input widget#23645
alice-i-cecile merged 14 commits intobevyengine:mainfrom
viridia:feathers_text_input

Conversation

@viridia
Copy link
Copy Markdown
Contributor

@viridia viridia commented Apr 3, 2026

Objective

Feathers text input widget
Part of #19236

Solution

Build a wrapper around EditableText that has feathers styling and themes.

Testing

WiP

@alice-i-cecile alice-i-cecile added C-Feature A new feature, making something new possible A-UI Graphical user interfaces, styles, layouts, and widgets A-Editor Graphical tools to make Bevy games S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Apr 4, 2026
@github-project-automation github-project-automation bot moved this to Needs SME Triage in UI Apr 4, 2026
@viridia viridia marked this pull request as ready for review April 5, 2026 18:37
@alice-i-cecile alice-i-cecile changed the title Work on feathers text input Feathers text input widget Apr 5, 2026
@alice-i-cecile alice-i-cecile added S-Needs-Review Needs reviewer attention (from anyone!) to move forward and removed S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Apr 5, 2026
@alice-i-cecile alice-i-cecile added this to the 0.19 milestone Apr 5, 2026
@alice-i-cecile alice-i-cecile added X-Uncontroversial This work is generally agreed upon D-Straightforward Simple bug fixes and API improvements, docs, test and examples labels Apr 5, 2026
@viridia viridia requested a review from ickshonpe April 6, 2026 19:40
});
}

fn update_text_input_focus(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we hook into the existing FocusIndicator infrastructure here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't, for two reasons:

  • This detects a focused descendant rather than a focused ancestor
  • The highlight uses an inset rect rather than an outline

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kk, that's fine, but leave a comment to this effect please :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment added; I suppose it's possible to generalize FocusIndicator in some way, but it seems like it would be complicated. In CSS this would be handled by the :focus-within pseudo-class.

Copy link
Copy Markdown
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a swapped match-on-bool here that's blocking. Rest is just cleanup.

@alice-i-cecile alice-i-cecile requested a review from kfc35 April 7, 2026 00:26
@lomirus
Copy link
Copy Markdown
Contributor

lomirus commented Apr 7, 2026

image

The text becomes invisible when selected.

@viridia
Copy link
Copy Markdown
Contributor Author

viridia commented Apr 7, 2026

The text becomes invisible when selected.

This is a known issue, which is being addressed in another PR.

Children [
(
text_input(TextInputProps {
max_characters: Some(9),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lets users enter a nine digit number, I'd have:

Suggested change
max_characters: Some(9),
max_characters: Some(8),

and prepend the "#" symbol with a Text entity

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, I'm going by what Srgb::hex and Srgb::to_hex do, which is to include the # in the string.

@kfc35 kfc35 added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 7, 2026
Co-authored-by: Kevin Chen <chen.kevin.f@gmail.com>
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Apr 7, 2026
Merged via the queue into bevyengine:main with commit 8f251ff Apr 7, 2026
38 checks passed
@github-project-automation github-project-automation bot moved this from Needs SME Triage to Done in UI Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Editor Graphical tools to make Bevy games A-UI Graphical user interfaces, styles, layouts, and widgets C-Feature A new feature, making something new possible D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it X-Uncontroversial This work is generally agreed upon

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants