Give developers direct control over TextBox focus state

As a developer, it is currently impossible to keep TextBoxes focused when a user interacts with another UI element (such as scrolling a ScrollingFrame or clicking a button). This makes our use case impossible because we want users to be able to scroll a list of text colours whilst editing their text. See example:

It’s not clear in the video, but clicking on any of the colours above the keyboard or attempting to scroll through them forces the textbox to unfocus. We attempt to fix this by listening to FocusLost and calling CaptureFocus in the same frame, but this results in an infinite focus and unfocus loop that can’t be broken out of. Waiting any longer than a frame causes the keyboard to disappear and ruins UX.

We need a way to disable Roblox’s default unfocus behaviour per TextBox.

22 Likes

This would be immensely useful for letting players edit the properties of text while having their keyboard opened & typing!

3 Likes

This has caused me some super frustrating issues with keyboards disappearing, this would be a fantastic addition.

2 Likes

Yep! I can do nothing to prevent the keyboard from disappearing here; I’ve done the absolute best I can do. We really need this issue resolved ASAP.

Currently having to work around this as well, really degrading the user experience in my experience. Only way around it has been waiting a short amount before calling CaptureFocus again but this results in a jumpy keyboard.

Not sure if anyone has a better way around this atm since calling CaptureFocus too soon will prevent the keyboard from displaying.

1 Like