Quickly grabbing and releasing textbox focus causes a multitude of issues

Capturing and releasing a TextBox’s focus in quick succession causes a multitude of issues, from UI bugs to errors.
This can be reproduced with the following snippet under a textbox:

script.Parent.Focused:Connect(function()
	script.Parent:ReleaseFocus()
	script.Parent:CaptureFocus()
end)

Visual aids:
(Studio Emulator) The emulator keyboard sticks on-screen and many errors are produced

(iOS Client) The screen jitters as the keyboard appears

Repro place:
textboxmobile_repro_a.rbxl (58.9 KB)

Hi @drewbluewasabi this behavior is expected. Calling capture focus within a focus changed handler will cause the event to fire again. Do you have a specific use-case that you’re trying to achieve?

Just an oversight on my part- sorry about that :sweat:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.