Fix: Chrome version number and fix focus after sidebar use #1152
+7,788
−996
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses two separate issues:
navigator.userAgentData
) instead of parsing the user-agent string. A fallback to the old method is retained for browsers that don't support the new API.event.preventDefault()
was being called too broadly, interfering with default browser actions like activating a link with the 'Enter' key.Relevant Technical Choices
navigator.userAgentData.getHighEntropyValues(['fullVersionList'])
to retrieve detailed browser and platform information. This approach is preferred as user-agent strings are becoming less reliable. If this API is not available, the logic falls back to the previous method of parsingnavigator.userAgent
with a regex.event.preventDefault()
andevent.stopPropagation()
have been moved from the top of theonKeyNavigation
handler into the specificif
blocks forArrowUp
,ArrowDown
,ArrowLeft
, andArrowRight
. This ensures we only prevent the default browser behavior for these specific navigation actions, allowing other keys (like 'Enter' or 'Space') to function as expected on sidebar items.Testing Instructions
Browser Version Detection
Sidebar Navigation
ArrowUp
andArrowDown
keys to navigate between items. Confirm that the selection moves as expected.ArrowRight
to open them andArrowLeft
to close them. Confirm this works correctly.Enter
key.Screenshot/Screencast
Checklist
- [ ] This code is covered by unit tests to verify that it works as intended.NAFixes #1139
Fixes #1143