We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 51af642 commit 61714ffCopy full SHA for 61714ff
packages/focus/src/index.js
@@ -134,12 +134,15 @@ export default function (Alpine) {
134
135
// Start trapping.
136
if (value && ! oldValue) {
137
- setTimeout(() => {
138
- if (modifiers.includes('inert')) undoInert = setInert(el)
139
- if (modifiers.includes('noscroll')) undoDisableScrolling = disableScrolling()
+ if (modifiers.includes('noscroll')) undoDisableScrolling = disableScrolling()
+ if (modifiers.includes('inert')) undoInert = setInert(el)
140
141
- trap.activate()
142
- });
+ // Activate the trap after two ticks. (Needed to play nice with transitions...)
+ setTimeout(() => {
143
+ trap.activate()
144
+ })
145
146
}
147
148
// Stop trapping.
0 commit comments