UserInputService:GetFocusedTextBox() returns nil with the chat box focused

UserInputService:GetFocusedTextBox() no longer detects when a player has the chat input box focused. As a result keybinds that I had set to be disabled while the player is typing are still firing with the chatbox focused. (I am aware there’s a better way to do this than using UserInputService:GetFocusedTextBox(), but I thought it’s still worth reporting.)

With chat box focused:

With normal text box focused:

Expected behavior

UserInputService:GetFocusedTextBox() should return the chat box if the player has it focused.

I second this discovery. It’s causing issues with functions bound by ContextActionService:BindActionAtPriority() where they will fire when the user is still chatting, severely impacting our gameplay

Pretty sure this issue is intended functionality now since update 686 with this change:

game.CoreGui and other restricted instances and services will no longer be accessible in scripts which do not have a permission to use them. Instead, attempt to index or retrieve such an instance from Roblox API method will return ‘nil’.

You should use ChatInputBarConfiguration.IsFocused alongside GetFocusedTextBox if you want to also include the ChatBar inside your keybind checks.

This change impacted basically every input handler that uses this over the game processed event like a-chassis, thank you Roblox, and thank you for posting a way to get around this change :pleading_face:

Workaround:

local IsFocused = function()
    return game:GetService("TextChatService").ChatInputBarConfiguration.IsFocused
end

This is most likely going to be closed as not a bug since this workaround (intended use) exists in the game engine.

Well then, as long as they didn’t break it by accident.
Annoying, but not difficult to fix at least. Thank you for the workaround.