mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
UI/AppKit: Prevent autocomplete popover from stealing focus
The autocomplete popover on macOS was stealing focus from the location bar when suggestions were displayed. This change saves the current first responder before showing the popover and restores it immediately after, ensuring the user can continue typing without interruption.
This commit is contained in:
parent
a0dbae02c8
commit
150828af98
Notes:
github-actions[bot]
2025-11-24 10:50:28 +00:00
Author: https://github.com/s21v1d9p 🔰
Commit: 150828af98
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6906
Reviewed-by: https://github.com/gmta ✅
1 changed files with 6 additions and 0 deletions
|
|
@ -151,9 +151,15 @@ static constexpr auto POPOVER_PADDING = 6uz;
|
|||
|
||||
[self showRelativeToToolbarItem:self.toolbar_item];
|
||||
|
||||
auto* window = [self.toolbar_item.view window];
|
||||
auto* first_responder = [window firstResponder];
|
||||
|
||||
[self showRelativeToRect:self.toolbar_item.view.frame
|
||||
ofView:self.toolbar_item.view
|
||||
preferredEdge:NSRectEdgeMaxY];
|
||||
|
||||
if (first_responder)
|
||||
[window makeFirstResponder:first_responder];
|
||||
}
|
||||
|
||||
- (void)selectRow:(NSInteger)row
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue