Tabs no longer work in textboxes

Textboxes no longer seem to accept tabs as input. I can observe this in our game CodeCombat Worlds, as well as @boatbomber’s popular education experience Lua Learning. This is a severe bug for both of these experiences as both of these programs rely on tabs for things like code block indentation.

To reproduce this, go into one of the experiences, find a code editor textbox, and then try typing a tab character and see nothing happens.

EDIT: This may have been the existing behavior. In addition, escape behavior has changed to pull up the menu. If you have a textbox focused and you hit escape, you need to hit escape once to unfocus the textbox and another time for the menu. I think this change might have been bundled together with it.

I thought this was a device issue, but I had another teammate repro it on their computer. It seems to have happened in the last day or two, and the bug does not seem to reproduce in Studio where tabs are still accepted inputs. I suspect this might be due to some kind of whitespace stripping going on, or some kind of input handling change.

Expected behavior

Tabs should insert a tab character into a textbox

6 Likes

This was always the case with TextBoxes

This was always a thing with textboxes. If you want to emulate tab spaces, simply gsub the tab’s string pattern.

local text = Textbox.Text
text.Text = text.Text:gsub('\t','    ')

With this bug, it doesn’t insert any characters, not a tab character, nor spaces.

Have you tried the code I gave before? It works for me.

I think we are talking about different things - I don’t mean that tab characters are inserting into the textbox, I mean that the production client actually doesn’t do anything when you hit tab when a Textbox is focused (no cursor movement, no inserted characters, etc.)

However, it does work as expected in Studio (hitting tab causes the cursor to move to the right.)

Ah, I think you may be right. I thought it might have been different on Mac, but maybe I just didn’t pay attention before to this behavior. I thought I reproduced a single escape opening up the Roblox menu while a textbox was focused, but perhaps I accidentally unfocused the textbox.

Are you sure? They both seem to be working for me.


What are the specs of the machines you’ve tested this on?

I’m using a Win 11 Intel laptop.

At least one of the machines was Mac on ARM, will double check on the second one (I think it was the same.)

UPDATE: The second machine is a Mac running ARM as well. We’ll test on Windows shortly.

We indeed can only reproduce this on Mac, Windows seems to be unaffected.

Any updates on this? We are going to try to work around this issue by looking at when the tab key is pressed but a new tab character is not inserted, though ideally we wouldn’t need to do that.

Possible workaround. Just receive the Tab input from UIS and check if the textbox is focused and then append whatever you want to the cursor position?

Yep, we have an elementary version of that working, though because it works on Windows but not Mac, we basically have to run a diff whenever the text changes and a tab input is received to see whether a tab was inserted or not, and insert it ourselves if it hasn’t.

Thanks for the report! Found someone to check this out.

Hello! Just wanted to let you know that I rolled out a flag to fix this. Can you confirm whether or not tabs work in Textboxes? Thanks!