Skip to content

Commit

Permalink
When navigating context menu using keyboard skip over item dividers
Browse files Browse the repository at this point in the history
  • Loading branch information
jelveh committed Jan 11, 2025
1 parent d6bbba7 commit 706a240
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/src/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ $(document).bind('keydown', async function(e){
let selected_item_index = $('.context-menu-active .context-menu-item').index(selected_item);
let new_selected_item_index = selected_item_index + 1;
let new_selected_item = $('.context-menu-active .context-menu-item').get(new_selected_item_index);
while($(new_selected_item).hasClass('context-menu-item-disabled')){
while($(new_selected_item).hasClass('context-menu-item-disabled') || $(new_selected_item).hasClass('context-menu-divider')){
new_selected_item_index = new_selected_item_index + 1;
new_selected_item = $('.context-menu-active .context-menu-item').get(new_selected_item_index);
}
Expand All @@ -166,7 +166,7 @@ $(document).bind('keydown', async function(e){
let selected_item_index = $('.context-menu-active .context-menu-item').index(selected_item);
let new_selected_item_index = selected_item_index - 1;
let new_selected_item = $('.context-menu-active .context-menu-item').get(new_selected_item_index);
while($(new_selected_item).hasClass('context-menu-item-disabled')){
while($(new_selected_item).hasClass('context-menu-item-disabled') || $(new_selected_item).hasClass('context-menu-divider')){
new_selected_item_index = new_selected_item_index - 1;
new_selected_item = $('.context-menu-active .context-menu-item').get(new_selected_item_index);
}
Expand Down

0 comments on commit 706a240

Please sign in to comment.