mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-09 20:52:54 +00:00
LibWeb: Fix moving through tabs with keyboard shortcuts
Previously, despite CTRL being held, the webpage elements such as checboxes (if existing) could 'hijact' moving to the next and previous tab with CTRL+TAB and CTRL+SHIFT+TAB.
This commit is contained in:
parent
532f156f4a
commit
cff48febf0
Notes:
github-actions[bot]
2025-03-04 12:38:30 +00:00
Author: https://github.com/rok-povsic
Commit: cff48febf0
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3793
1 changed files with 6 additions and 4 deletions
|
@ -1148,10 +1148,12 @@ EventResult EventHandler::handle_keydown(UIEvents::KeyCode key, u32 modifiers, u
|
|||
|
||||
GC::Ref<DOM::Document> document = *m_navigable->active_document();
|
||||
|
||||
if (key == UIEvents::KeyCode::Key_Tab) {
|
||||
if (modifiers & UIEvents::KeyModifier::Mod_Shift)
|
||||
return focus_previous_element() ? EventResult::Handled : EventResult::Dropped;
|
||||
return focus_next_element() ? EventResult::Handled : EventResult::Dropped;
|
||||
if (!(modifiers & UIEvents::KeyModifier::Mod_Ctrl)) {
|
||||
if (key == UIEvents::KeyCode::Key_Tab) {
|
||||
if (modifiers & UIEvents::KeyModifier::Mod_Shift)
|
||||
return focus_previous_element() ? EventResult::Handled : EventResult::Dropped;
|
||||
return focus_next_element() ? EventResult::Handled : EventResult::Dropped;
|
||||
}
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/interaction.html#close-requests
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue