PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

ReleaseFocus

Forces the client to unfocus the TextBox.

The submitted parameter allows you to over-ride the enterPressed parameter in the FocusLost event.

Notes

  • This item should be used with a `LocalScript` in order to work as expected in online mode.

Example

The code shown below will force the client to unfocus the 'TextBox' 5 seconds after it's selected:

local TextBox = script.Parent
TextBox.Focused:Connect(function()
	wait(5)
	TextBox:ReleaseFocus()
end)

Please be aware that the above example assumes that it's in a LocalScript, as a child of a TextBox.


Parameters

Name Type Default Description
false

Returns

Return Type Summary

Code Samples


TextBox:ReleaseFocus

The code shown below will force the client to unfocus the ‘TextBox’ 5 seconds after it’s selected:

local TextBox = script.Parent
TextBox.Focused:Connect(function()
	wait(5)
	TextBox:ReleaseFocus()
end)