You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to premise by saying that I just started using cacao so probably there's something silly I'm missing. I apologize in advance if that's the case.
The issue that I have is very simple: is there a way for a TextField to not be on edit mode right when the window finishes loading? Meaning: when the window is done loading and showing the TextField immediately awaits for input. Is there a way you can have it inactive until you click on it, as if "enter" is the first thing pressed? I can't figure out a way to make this work even though it sounds like a simple task :/
You can use the text_input.rs in the examples folder as an example.
Thanks
The text was updated successfully, but these errors were encountered:
jimmy-hypi
changed the title
TextField not focused at window opening
TextField not on edit mode at window opening
Sep 8, 2023
You probably need to call [window makeFirstResponder:nil] (which we need to add on the Window in appkit) or you could try programmatically calling resignFirstResponder to hack around it for now.
e.g (pseudocode, you'll want to use the with_ accessor to get the native handle):
If that works, feel free to PR one (or both) to the library - they should be straightforward-ish to handle. I can't merge it until another PR is in, but this change shouldn't be interfering with it so it'd be nice to have lined up.
Unfortunately I'm afraid I'm not familiar enough with the framework to be able to make useful changes. In particular, I'm not sure where to call the code you suggested. To the best of my understanding, using resignFirstResponder the native handle should be the TextField handle right?
All the changes that I'm trying to apply are just ignored. But again, quite a trial and error as I have very little clue of what I'm doing.
I want to premise by saying that I just started using cacao so probably there's something silly I'm missing. I apologize in advance if that's the case.
The issue that I have is very simple: is there a way for a TextField to not be on edit mode right when the window finishes loading? Meaning: when the window is done loading and showing the TextField immediately awaits for input. Is there a way you can have it inactive until you click on it, as if "enter" is the first thing pressed? I can't figure out a way to make this work even though it sounds like a simple task :/
You can use the text_input.rs in the examples folder as an example.
Thanks
The text was updated successfully, but these errors were encountered: