-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
SetKeyboardFocusHere() issue with changing widgets #432
Comments
And of course I've just realized this is because I should only be calling SetKeyboardFocusHere() once. Is there an easy way to do this without adding a do-once flag? |
Hello, An extra condition flag may be useful using an _Appearing condition but otherwise not much. In the Console demo code I test if no widgets are active before calling SetKeyboardFocusHere(). However, either way the behavior you are reporting is a bug. The reason is that SetKeyboardFocusHere() currently defer the focus setting to the next frame because it may be called with a negative parameter. I have a todo entry to handle that better, either by handling >= 0 offsets immediately either by locking on the id to focus so that when you press Enter and stop displaying your widget it won't focus another one. Currently focusing is expecting stable widget order so changing the widget breaks it. I'll look this this issue but I don't know when. Fix shoulnd't be too hard. |
Better late than never :) This is now fixed by the current rework of the tabbing system. |
I'm messing around with the sample node editor code you posted (https://gist.github.com/ocornut/7e9b3ec566a333d725d4) and while implementing rename, I noticed an odd issue. With the following code, the SliderFloat will end up getting focus after hitting enter on the InputText.
However the following will not show the same problem.
Thoughts?
The text was updated successfully, but these errors were encountered: