From 6c35e01acbbfd6d7a9f7add3ce9ebebab6412537 Mon Sep 17 00:00:00 2001 From: hius07 <62179190+hius07@users.noreply.github.com> Date: Tue, 29 Jun 2021 22:42:18 +0300 Subject: [PATCH] InputDialog: manage keyboard hiding (#7908) Disable keyboard hiding with Tap in some cases. --- frontend/ui/widget/inputdialog.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/ui/widget/inputdialog.lua b/frontend/ui/widget/inputdialog.lua index 033ff1080..24707b3a3 100644 --- a/frontend/ui/widget/inputdialog.lua +++ b/frontend/ui/widget/inputdialog.lua @@ -127,6 +127,7 @@ local InputDialog = InputContainer:new{ description = nil, buttons = nil, input_type = nil, + deny_keyboard_hiding = false, -- don't hide keyboard on tap outside enter_callback = nil, readonly = false, -- don't allow editing, will not show keyboard allow_newline = false, -- allow entering new lines (this disables any enter_callback) @@ -216,6 +217,9 @@ function InputDialog:init() if self.readonly then -- hide keyboard if we can't edit self.keyboard_hidden = true end + if self.fullscreen or self.add_nav_bar then + self.deny_keyboard_hiding = true + end -- Title & description self.title_widget = FrameContainer:new{ @@ -466,7 +470,7 @@ function InputDialog:init() end function InputDialog:onTap() - if self.fullscreen or self.add_nav_bar then + if self.deny_keyboard_hiding then return end self._input_widget:onCloseKeyboard() @@ -749,6 +753,7 @@ function InputDialog:_addScrollButtons(nav_bar) input_dialog = InputDialog:new{ title = _("Enter text to search for"), stop_events_propagation = true, -- avoid interactions with upper InputDialog + deny_keyboard_hiding = true, input = self.search_value, buttons = { { @@ -818,6 +823,7 @@ function InputDialog:_addScrollButtons(nav_bar) input_hint = T(_("%1 (1 - %2)"), cur_line_num, last_line_num), input_type = "number", stop_events_propagation = true, -- avoid interactions with upper InputDialog + deny_keyboard_hiding = true, buttons = { { {