iOS: ensure we close inputpanel after clearing focusobject
Change 7f72622c0f caused a regression where the input panel would not close automatically when the focus object was cleared. The reason is that it's apparently not enough to just release the first responder, we also need to explicitly tell it to release it's first responder status. Before the failing patch, we did this from within update(). This patch will instead/in addition do an extra check from inside reset(). Fixes: QTBUG-105323 Change-Id: I00bdd44fe54db69f44232226291e3c5715935749 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit e2e4428f0ffa79a032f56812dd89f0b8b8af63f9)
This commit is contained in:
parent
4e26f06a98
commit
22fbdd9765
@ -743,10 +743,19 @@ void QIOSInputContext::reset()
|
||||
// UITextInteraction protocol).
|
||||
[m_textResponder setMarkedText:@"" selectedRange:NSMakeRange(0, 0)];
|
||||
[m_textResponder notifyInputDelegate:Qt::ImQueryInput];
|
||||
const auto oldResponder = m_textResponder;
|
||||
[m_textResponder autorelease];
|
||||
m_textResponder = nullptr;
|
||||
|
||||
update(Qt::ImQueryAll);
|
||||
|
||||
// If update() didn't end up creating a new text responder, oldResponder will still be
|
||||
// the first responder. In that case we need to resign it, so that the input panel hides.
|
||||
// (the input panel will apparently not hide if the first responder is only released).
|
||||
if ([oldResponder isFirstResponder]) {
|
||||
qImDebug("IM not enabled, resigning autoreleased text responder as first responder");
|
||||
[oldResponder resignFirstResponder];
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
|
Loading…
x
Reference in New Issue
Block a user