Attempting to set a custom TextBox for ChatInputBarConfiguration
automatically fires the Focused
event. This occurs after assigning a custom TextBox to ChatInputBarConfiguration
, and regardless of whether or not you connect the Focused
event.
Steps in Studio (a Baseplate template will suffice);
- Add a
ScreenGui
with aTextBox
object toStarterGui
- The following can be added to a
LocalScript
and placed inStarterPlayerScripts
:
local LocalPlayer = game:GetService("Players").LocalPlayer
local PlrGui = LocalPlayer:WaitForChild("PlayerGui")
local InputConfig = game:GetService("TextChatService"):FindFirstChildOfClass("ChatInputBarConfiguration")
local ChatBox = PlrGui:WaitForChild("Chatbox")
InputConfig.TextBox = ChatBox.TextBox
InputConfig.TextBox.Focused:Connect(function()
print"focused"
end)
InputConfig.TextBox.FocusLost:Connect(function()
print"focuslost"
end)
- Click Play. Almost immediately on spawn, the
Focused
event will automatically fire and print"focused"
once, without any other input.
Repro:
ChatInputBugRepro.rbxl (60.9 KB)
Expected behavior
Setting a custom TextBox should not fire the Focused event.