From 80cc01aeb5fcc81906308c45e5bac1079c5ef905 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Thu, 4 Feb 2021 16:09:24 +0100 Subject: [PATCH] iOS: close edit menu upon focus transfer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If you select text, the edit menu will show. But if you tap directly inside another input field, and as such, transfer focus, the menu will continue to stay visible. This patch will ensure that we hide the edit menu when the input field that it was requested for looses focus. Fixes: QTBUG-90937 Change-Id: I1d97bd57fc793826a3170404795b06a1e058d1b7 Reviewed-by: Morten Johan Sørvig (cherry picked from commit 0bae5fbabbb64371b1b6c646ce0a32e084e42f83) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/platforms/ios/qiostextinputoverlay.mm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/platforms/ios/qiostextinputoverlay.mm b/src/plugins/platforms/ios/qiostextinputoverlay.mm index 5776c364c45..65a296e8973 100644 --- a/src/plugins/platforms/ios/qiostextinputoverlay.mm +++ b/src/plugins/platforms/ios/qiostextinputoverlay.mm @@ -747,6 +747,9 @@ static void executeBlockWithoutAnimation(Block block) QObject::disconnect(_cursorConnection); QObject::disconnect(_anchorConnection); QObject::disconnect(_clipRectConnection); + + if (QIOSTextInputOverlay::s_editMenu.shownByUs) + QIOSTextInputOverlay::s_editMenu.visible = NO; } }