Skip to content

x-collapse plugin rendering issue on children components #4437

Answered by SimoTod
kiriamcf-revo asked this question in 5. Bugs
Discussion options

You must be logged in to vote

I think the code is more complex than it should be:

<div x-data="{showParent: false}">
    <button type="button" x-on:click="showParent = !showParent">Display parent</button>
    <div x-show="showParent"
        x-cloak
        x-data="{showChildren: false}" 
        x-transition.opacity.duration.300
        x-effect="if (showParent == false) $nextTick(() => showChildren = false)">
        Parent component
        <button type="button" x-on:click="showChildren = !showChildren">Display children</button>
        <div x-show="showChildren" x-cloak x-collapse.duration.300>
            Children component
        </div> 
    </div>
</div>

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@kiriamcf-revo
Comment options

@SimoTod
Comment options

Answer selected by kiriamcf-revo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants