PcoWSkbVqDnWTu_dm2ix
The Developer Hub is now deprecated and information on this page may no longer be accurate. To see our new and improved documentation, please click here. You can read more about the future of documentation here.
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: