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
| Question | Required unless you change it |
|---|---|
NumberInput | yes |
TapPicker, GestureRecorder | yes, when they have no default |
TapListPicker | yes |
Slider | always 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