From fcd77901bf4a6d94b2dc3838d1c033b1fb860b7d Mon Sep 17 00:00:00 2001 From: Jessica Lawshe <5312836+lawshe@users.noreply.github.com> Date: Thu, 11 Apr 2024 08:28:18 -0500 Subject: [PATCH] Merge pull request #17878 from overleaf/mj-keyboard-navigation-firefox-115 [web] Use getAttribute rather than accessing Element.role GitOrigin-RevId: a6732180d945ccc4ac0300af07e52228e9f2c928 --- .../source-editor/extensions/spelling/context-menu.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/web/frontend/js/features/source-editor/extensions/spelling/context-menu.ts b/services/web/frontend/js/features/source-editor/extensions/spelling/context-menu.ts index e0d516f06c..62ab5625b9 100644 --- a/services/web/frontend/js/features/source-editor/extensions/spelling/context-menu.ts +++ b/services/web/frontend/js/features/source-editor/extensions/spelling/context-menu.ts @@ -189,7 +189,7 @@ const createSpellingSuggestionList = (word: Word, view: EditorView) => { // get next option let nextElement = selectedButton.parentElement?.nextElementSibling - if (nextElement?.role !== 'option') { + if (nextElement?.getAttribute('role') !== 'option') { nextElement = nextElement?.nextElementSibling } nextElement?.querySelector('button')?.focus() @@ -211,7 +211,7 @@ const createSpellingSuggestionList = (word: Word, view: EditorView) => { // get previous option let previousElement = selectedButton.parentElement?.previousElementSibling - if (previousElement?.role !== 'option') { + if (previousElement?.getAttribute('role') !== 'option') { previousElement = previousElement?.previousElementSibling } previousElement?.querySelector('button')?.focus()