I have a system where I listen to Text changes on a TextBox and revert the change to gather native input. When I call CaptureFocus() inside of the Text changed event after resetting the text of the TextBox, two Focused events are fired.
I would only expect one Focused event to fire, and it is currently impossible for me to skip the Focused events triggered by calling CaptureFocus() over manually clicking/tapping/selecting the TextBox, as they seem to happen several frames after I call CaptureFocus.
TextBoxBugReport.rbxl (12.9 KB)
I expect that the Focused event would trigger while I call CaptureFocus(), and that CaptureFocus() only finishes after I have received the Focused event caused by this method call.
Adding a lock variable to the place file’s code above will show this output:
The first event fired is happening during the CaptureFocus() call, but the second event happens sometime after the method call is done.