Skip to content

NumberEditLib:onFocus

since 1.5.14

Function called when the focus is changed.

field:onFocus(handler)

Parameters

Name Type Required Description
handler function yes function(state)

Returns

Nothing.

Examples

From the official Ethos documentation
local line = form.addLine("Number edit line")
local value = 10
local field = form.addNumberField(line, nil, 0, 10, function() return value end, function(newValue) value = newValue end)
field:onFocus(function(state) print("onFocus .. " .. state))