TextBox.Text not updating on backspace/delete

While you’re entering text in a TextBox, .Changed fires almost everytime due .Text changes.
If you would do “while wait() do print(.Text) end” it’ll also print the same text except:
When you press backspace to remove a character, .Text stays unchanged.

(Operation → Resulting .Text)
TB.Text = “a” → “a”
presses b → “ab”
*presses backspace → “ab” (Visually it shows “a”, but .Text doesn’t change)
*presses backspace → “ab” (IDEM)
presses c → “c”

I thought I could work around this bug using UserInputService.InputBegan (/InputChanged/InputEnded)
But, apparently, those don’t work (yet) and I’m not sure they would work when focused on a TextBox.

1 Like

I just attempted this, in the same order you did - and it was detecting backspace for me. I did try it with both the .Changed event, and using a loop as you suggested.

TB.Text = “a” → “a”
presses b → “ab”
presses backspace → “a”
presses backspace → “”
presses c → “c”

Also online?
(Note, the TextBox is completely invisible, so is TextTransparency, not that it should atter)
(Another note, if you set the Position to {1,0,0,0} for example, it’ll bug more)

[quote] Also online?
(Note, the TextBox is completely invisible, so is TextTransparency, not that it should atter)
(Another note, if you set the Position to {1,0,0,0} for example, it’ll bug more) [/quote]

Just tested it online - Also using the looping method stated -

Apparently you’re all right, it’s just my code that bugs out roblox:

TB.Changed:connect(function()
local t = TB.Text TB.Text = “a”
– Do stuff with variable t
end)

Apparently that sort of blocks input most of the time … (adding a wait() doesn’t solve it)

I also noticed this problem when trying to make a custom chat, as well as changed firing oddly, like not every letter but sometimes once every 2 letters or even 3. The whole thing just seemed generally buggy but worked fine when it only updated when the user pressed enter.