floem icon indicating copy to clipboard operation
floem copied to clipboard

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

Open charlescgs opened this issue 1 year ago • 4 comments

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.

charlescgs avatar Nov 19 '24 22:11 charlescgs

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

jrmoulton avatar Nov 21 '24 18:11 jrmoulton

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 avatar Dec 02 '24 23:12 charlescgs

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 avatar Dec 03 '24 09:12 charlescgs

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

charlescgs avatar Dec 29 '24 23:12 charlescgs