Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ui Editable TextBox #12109

Closed
miketwenty1 opened this issue Feb 25, 2024 · 4 comments
Closed

Ui Editable TextBox #12109

miketwenty1 opened this issue Feb 25, 2024 · 4 comments
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets C-Enhancement A new feature

Comments

@miketwenty1
Copy link

miketwenty1 commented Feb 25, 2024

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

  • Implementing an editable textbox in Bevy UI is currently very difficult.
  • The best method I've devised appears quite involved, requiring a significant amount of boilerplate logic related to formatting and using the ButtonBundle.
  • For now, the most practical method to obtain a textbox is through a third-party dependency. However, as Bevy is still rapidly evolving, relying on third-party support for a critical feature is challenging if you aim to keep up with the latest and greatest Bevy features.

What solution would you like?

I'm proposing a textbox as a first-class UI element in Bevy.

Nice to have features:

  • Selectable.
  • Blinking cursor location.
  • Able to move cursor within string input.
  • Able to handle and switch keyboard input to multiple textboxes
  • Tab keyboard key moves cursor to "next textbox" location.
  • Copy/Paste (Clipboard) magically work. (Including Wasm builds).

What alternative(s) have you considered?

  • UiButton with a bunch of love.
@miketwenty1 miketwenty1 added C-Enhancement A new feature S-Needs-Triage This issue needs to be labelled labels Feb 25, 2024
@miketwenty1 miketwenty1 changed the title Ui TextBox Ui Editable TextBox Feb 25, 2024
@alice-i-cecile alice-i-cecile added A-UI Graphical user interfaces, styles, layouts, and widgets and removed S-Needs-Triage This issue needs to be labelled labels Feb 25, 2024
@alice-i-cecile
Copy link
Member

#12100 is very useful for this.

@rparrett
Copy link
Contributor

rparrett commented Feb 25, 2024

This is a duplicate of #6213. Some broad UI goals / issues for specific widgets have been tracked here: https://github.com/orgs/bevyengine/projects/10 in the past.

The best method I've devised appears quite involved, requiring a significant amount of boilerplate logic related to formatting and using the ButtonBundle.

Could you elaborate on the challenges you've faced implementing this? Because the same challenges will exist in-engine and we will want to work towards improving that. We should identify specific issues and try to fix them. For example: #11297.

Cursors / selection are definitely difficult at the moment, though probably not impossible. I can't recall if #10193 would actually help with that.

Doing this in-engine at this moment also seems difficult/blocked at the moment while we wait to see how #9538 turns out, which is a favored proposal for spawning widgets consisting of multiple entities.

@miketwenty1
Copy link
Author

@rparrett

This is a duplicate of #6213. Some broad UI goals / issues for specific widgets have been tracked here:

I'm thinking this isn't quite a duplicate. I'm asking for more than just input unicode text, I'm asking for a fully functioning textbox that you could expect to see on a website.

Could you elaborate on the challenges you've faced implementing this?

Trying to implement a Cursor as a blinking pipe within button text is not ideal. Using the button UI to help with selection. Keeping track in a nice neat way all the buffers for all the text boxes and switching between them was non-trivial for me. Adding keeping track of a cursor on top of that is additional complexity.

Doing this in-engine at this moment also seems difficult/blocked at the moment while we wait to see how #9538 turns out, which is a favored proposal for spawning widgets consisting of multiple entities.

It seems this issue is blocked until #9538 is done/merged?

@alice-i-cecile
Copy link
Member

I agree with the need for a fully featured textbox (including copy-paste, cursors, focus and more). That said, I think it'll be much easier to track this work if we avoid splitting the discussion.

@alice-i-cecile alice-i-cecile closed this as not planned Won't fix, can't repro, duplicate, stale Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets C-Enhancement A new feature
Projects
None yet
Development

No branches or pull requests

3 participants