Android: Clear QtEditText focus after keyboard is hidden
Since QtEditText only needs focus for the virtual keyboard, focus should then be removed once we're done with the virtual keyboard. After this, focus will be received back by QtWindow, which will then handle key inputs properly. As a drive-by, remove the default focus highlight on QtWindow to stop the ugly flickering that happens when QtWindow receives focus back from QtEditText. Pick-to: 6.7 Task-number: QTBUG-126187 Change-Id: I911e3371d9c582b2805dc895ef49b0d4210714f3 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io> (cherry picked from commit dc71864d4a358149a2531d324645934e47879dba) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
f35cc3a115
commit
b48b0dba63
@ -286,9 +286,11 @@ class QtInputDelegate implements QtInputConnection.QtInputConnectionListener, Qt
|
||||
m_keyboardIsVisible = visibility;
|
||||
keyboardVisibilityUpdated(m_keyboardIsVisible);
|
||||
|
||||
if (!visibility) {
|
||||
// Hiding the keyboard clears the immersive mode, so we need to set it again.
|
||||
if (!visibility)
|
||||
m_keyboardVisibilityListener.onKeyboardVisibilityChange();
|
||||
m_currentEditText.clearFocus();
|
||||
}
|
||||
}
|
||||
|
||||
void setFocusedView(QtEditText currentEditText)
|
||||
|
@ -32,6 +32,7 @@ class QtWindow extends QtLayout implements QtSurfaceInterface {
|
||||
m_inputConnectionListener = listener;
|
||||
setParent(parentWindow);
|
||||
setFocusableInTouchMode(true);
|
||||
setDefaultFocusHighlightEnabled(false);
|
||||
|
||||
// Views are by default visible, but QWindows are not.
|
||||
// We should ideally pick up the actual QWindow state here,
|
||||
|
Loading…
x
Reference in New Issue
Block a user