Skip to content

Commit dad54d8

Browse files
committed
Update #199 rename IS_CONSUME_INPUT_WHILE_SELECTED to NO_CONSUME_INPUT_WHILE_SELECTED. Change default value
1 parent 7f5be3f commit dad54d8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

druid/extended/input.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ end
8787
-- @tfield[opt=false] bool IS_LONGTAP_ERASE Is long tap will erase current input data
8888
-- @tfield[opt=*] string MASK_DEFAULT_CHAR Default character mask for password input
8989
-- @tfield[opt=false] bool IS_UNSELECT_ON_RESELECT If true, call unselect on select selected input
90-
-- @tfield[opt=false] bool IS_CONSUME_INPUT_WHILE_SELECTED If true, will consume input while input is selected. If false - it's allow to interact with other input component while selected
90+
-- @tfield[opt=false] bool NO_CONSUME_INPUT_WHILE_SELECTED If true, will not consume input while input is selected. It's allow to interact with other components while input is selected (text input still captured)
9191
-- @tfield function on_select (self, button_node) Callback on input field selecting
9292
-- @tfield function on_unselect (self, button_node) Callback on input field unselecting
9393
-- @tfield function on_input_wrong (self, button_node) Callback on wrong user input
@@ -98,7 +98,7 @@ function Input.on_style_change(self, style)
9898
self.style.IS_LONGTAP_ERASE = style.IS_LONGTAP_ERASE or false
9999
self.style.MASK_DEFAULT_CHAR = style.MASK_DEFAULT_CHAR or "*"
100100
self.style.IS_UNSELECT_ON_RESELECT = style.IS_UNSELECT_ON_RESELECT or false
101-
self.style.IS_CONSUME_INPUT_WHILE_SELECTED = style.IS_CONSUME_INPUT_WHILE_SELECTED or false
101+
self.style.NO_CONSUME_INPUT_WHILE_SELECTED = style.NO_CONSUME_INPUT_WHILE_SELECTED or false
102102

103103
self.style.on_select = style.on_select or function(_, button_node) end
104104
self.style.on_unselect = style.on_unselect or function(_, button_node) end
@@ -216,7 +216,7 @@ function Input.on_input(self, action_id, action)
216216
end
217217
end
218218

219-
local is_consume_input = self.style.IS_CONSUME_INPUT_WHILE_SELECTED and self.is_selected
219+
local is_consume_input = not self.style.NO_CONSUME_INPUT_WHILE_SELECTED and self.is_selected
220220
return is_consume_input
221221
end
222222

druid/styles/default/style.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ M["input"] = {
113113
BUTTON_SELECT_INCREASE = 1.06,
114114
MASK_DEFAULT_CHAR = "*",
115115
IS_UNSELECT_ON_RESELECT = false,
116-
IS_CONSUME_INPUT_WHILE_SELECTED = true,
116+
NO_CONSUME_INPUT_WHILE_SELECTED = false,
117117

118118
on_select = function(self, button_node)
119119
local target_scale = self.button.start_scale

0 commit comments

Comments
 (0)