Skip to content

Commit

Permalink
Fix highlight.focus
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyEJohnson committed Apr 15, 2024
1 parent 16cb18f commit 8b94268
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/Highlight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,8 @@ export default class Highlight {
* @return boolean indicating if the action was a success.
*/
public focus(): boolean {
const focusableElement = this.elements[0].querySelector(DATA_SCREEN_READERS_ATTR_SELECTOR) as HTMLElement | null;
if (focusableElement) {
focusableElement.focus();
return true;
}
return false;
this.elements[0].focus();
return true;
}

public intersects(range: Range): boolean {
Expand Down

0 comments on commit 8b94268

Please sign in to comment.