Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions js/a11y/browserFocus.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ export default class BrowserFocus extends Backbone.Controller {
if (!element) return;
// refocus on the existing active element to stop jaws from scrolling
this.a11y.focus(element, { preventScroll: true });
// Firefox sets a persistent selection anchor when focus is assigned
// programmatically, causing text to be unexpectedly selected on subsequent
// clicks. Clear any selection to prevent this.
window.getSelection()?.removeAllRanges();
}

/**
Expand Down
Loading