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

No way to manually focus a TextBox #1047

Closed
SuperCuber opened this issue Aug 19, 2017 · 4 comments
Closed

No way to manually focus a TextBox #1047

SuperCuber opened this issue Aug 19, 2017 · 4 comments

Comments

@SuperCuber
Copy link

Maybe searching for an hour in the docs is not enough, but for the life of me I cannot find a way to focus a TextBox without a user clicking on it. I tried to hack around it by simulating an event or something like that but couldn't find a way to do that either.

I assume the state of focus is cached in the UI (in your retained & immediate hybrid model), and I suggest bringing that state to the user of the library similarly to how the user of the library has to handle the contents of the textbox.

@mitchmindtree
Copy link
Contributor

You can find some discussion on how we should approach this at #606, however I don't think anything has been settled upon or implemented yet.

Whether or not a widget is focused is tracked within the Ui's current Global state by tracking which widget is currently capturing input from each device.

I think a nice way to provide this control to the user would be via a method along these lines: ui.capture_mouse/keyboard_with(widget_id) which internally emits two events:

  1. event::Ui::WidgetUncapturesInputSource(id, source) where id is the id of the widget previously capturing the input source
  2. event::Ui::WidgetCapturesInputSource(widget_id, source) where widget_id is the ID of the widget specified by the user (in your case the ID for your TextBox) that should now capture the input source.

Perhaps we could then use these methods as a foundation for providing higher level helpers for tabbing between input fields, etc.

@SuperCuber
Copy link
Author

@mitchmindtree Any updates on this?

@zeyonaut
Copy link

Has any consensus been made on how this will be implemented?

@MrGibus
Copy link

MrGibus commented Oct 1, 2020

Any update on this? I've created a table but manually selecting each element is really tedious.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants