Focus plugin x-trap.inert.noscroll issue with ajax content on Alpine 3.14.4+ #4582
Unanswered
nboliver-ventureweb
asked this question in
5. Bugs
Replies: 1 comment
-
|
There was a major change to how Alpine tracks and handles reinitializing elements and unfortunately a lot of it was only compatible with Livewire. One thing I can recommend, is could you have the thing that swaps the html only swap the CONTENTS of the element with x-trap? and not the x-trap element itself? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
With a cart drawer that updates via ajax when items are added, and uses
x-trap.inert.noscrollwhen the drawer is open, thenoscrollmodifier is not removed when the drawer is closed.If the drawer is opened with no ajax update, everything works as expected, but replacing the markup before opening the drawer causes the noscroll to stop functioning when the drawer is closed. The expression that triggers the x-trap is evaluating correctly, and the focus is returned to the previous element when the drawer closes, so it's just the noscroll that's not being removed.
Update:
This appears to be an issue related to updating from
[email protected]to[email protected], as the issue is not happening after downgrading. I tracked the breaking change to v3.14.4.Beta Was this translation helpful? Give feedback.
All reactions