본문으로 건너뛰기

setRequired()

Chooses whether OK waits for an answer to this question. It is on NumberInput, Slider, TapPicker, TapListPicker and GestureRecorder.

Signature​

setRequired(required: boolean): DialogComponent

Returns

The same question, so calls can chain

Which questions are required​

QuestionRequired unless you change it
NumberInputyes
TapPicker, GestureRecorderyes, when they have no default
TapListPickeryes
Slideralways has an answer

Example​

-- Optional: the macro uses its own search when the user skips it
Dialog:add(TapPicker(1, "Tap the Search button"):setRequired(false))
Dialog:show()
local search = Dialog:getValueById(1)
if search ~= nil then
Screen:click(search, ClickParams())
end