Skip to content

Commit

Permalink
fix: force focus state to dropdown.trigger as `document.activeElement…
Browse files Browse the repository at this point in the history
…` stays in body even with clicking #99
  • Loading branch information
sun-mota committed Dec 27, 2024
1 parent b3c90b4 commit 31a284d
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
30 changes: 28 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"dependencies": {
"handlebars": "^4.7.8",
"markdown-magic": "^2.6.1",
"@floating-ui/dom": "^1.6.11",
"npm-run-all": "^4.1.5"
}
}
3 changes: 3 additions & 0 deletions scripts/runtime/floatingUI.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,9 @@ export default class AuroFloatingUI {
this.handleFocusLoss();
break;
case 'click':
if (document.activeElement === document.body) {
event.currentTarget.focus();
}
this.handleClick();
break;
default:
Expand Down

0 comments on commit 31a284d

Please sign in to comment.