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

Bug: request_focus() on editor does not focus the editor #693

Open
charlescgs opened this issue Nov 19, 2024 · 4 comments
Open

Bug: request_focus() on editor does not focus the editor #693

charlescgs opened this issue Nov 19, 2024 · 4 comments

Comments

@charlescgs
Copy link
Contributor

Right now requesting focus on Text Editor does not focus the view correctly, but focus one of the outer wrapper instead, what make editor not reacting on the keyboard strokes.

@jrmoulton
Copy link
Collaborator

One way you can do this is to use the id that the editor stores

editor_a.editor().editor_view_id

if you request focus using that id, the correct view will get keyboard events

@charlescgs
Copy link
Contributor Author

Hey, tried to do it on floem editor example:
editor_example_panic

...but as soon as you press any keyboard key, the app panics:
editor_focs_panic

@charlescgs
Copy link
Contributor Author

But it works fine as long as you don't clear the Document before requesting focus. If you clear it, then it panics after first keystroke. Any idea what it may cause it?

@charlescgs
Copy link
Contributor Author

Another way to try to focus editor that fails: #392

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

2 participants