From 8439b9fd06f78da4a14b920d0b9e4cf02403e90d Mon Sep 17 00:00:00 2001 From: anoshenko Date: Sun, 21 Nov 2021 18:30:46 +0300 Subject: [PATCH] Fixed the focus bug show of popup showing --- popup.go | 2 ++ view.go | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/popup.go b/popup.go index 7762c22..38c3f7f 100644 --- a/popup.go +++ b/popup.go @@ -316,6 +316,8 @@ func (manager *popupManager) showPopup(popup Popup) { } else { manager.popups = append(manager.popups, popup) } + + session.runScript(`if (document.activeElement != document.body) document.activeElement.blur();`) manager.updatePopupLayerInnerHTML(session) updateCSSProperty("ruiPopupLayer", "visibility", "visible", session) } diff --git a/view.go b/view.go index aa2bfd7..2c57464 100644 --- a/view.go +++ b/view.go @@ -56,11 +56,10 @@ type View interface { // Return "true" if the value has been set, in the opposite case "false" are returned and // a description of the error is written to the log SetAnimated(tag string, value interface{}, animation Animation) bool - + // SetChangeListener set the function to track the change of the View property SetChangeListener(tag string, listener func(View, string)) handleCommand(self View, command string, data DataObject) bool - //updateEventHandlers() htmlClass(disabled bool) string htmlTag() string closeHTMLTag() bool