Directive that does something before element shows / hides #2771
Unanswered
mikestempien
asked this question in
1. Help
Replies: 1 comment 3 replies
-
All custom directives run after the canonical ones so probably they wouldn't help but you can just use x-init: |
Beta Was this translation helpful? Give feedback.
3 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.
-
While the Collapse plugin is great out of the box, I'd like to control transition with CSS. I'm not really familiar with how Alpine works under the hood, but here's what I'm thinking:
Instead of
x-collapse
having to deal with everything I'd need some directive that would only check for element'sscrollHeight
before it's being shown/hidden and store it in a custom property ex:--height
. I'd use that in conjunction withx-transform
class names to transition the height myself, via CSS.So the question is, how to write a directive that would do something before show / transition class names being applied?
Beta Was this translation helpful? Give feedback.
All reactions