mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02: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:
Notes:
github-actions[bot]
2025-11-24 10:50:28 +00:00
Author: https://github.com/s21v1d9p 🔰 Commit: https://github.com/LadybirdBrowser/ladybird/commit/150828af985 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6906 Reviewed-by: https://github.com/gmta ✅
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user