Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

Separator: Closed on load is open #48

Closed
ault opened this issue Jan 22, 2021 · 4 comments
Closed

Separator: Closed on load is open #48

ault opened this issue Jan 22, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@ault
Copy link

ault commented Jan 22, 2021

Umbraco 8.9.1, Matryoshka 07.0

I have 4 instances of the same separator in use on the same component data-type...

It is set as an anchor, and "Collapsible, closed on load".

When in use, the first and third separators come in as expected (i.e. closed on open). However, the second and fourth are open. Nothing appears in the devtools console.

Is this a known issue?

@skttl
Copy link
Owner

skttl commented Jan 22, 2021

I didn't know it :)

@skttl skttl added the bug Something isn't working label Jan 22, 2021
@ault
Copy link
Author

ault commented Jan 22, 2021

My ng is not very hot, but I'm wondering if the bug lives in this:

`
$scope.toggleCollapse = function() {

        $timeout(function() {
        
            separator.toggleClass("our-matryoshka-group-separator--collapsed");
            
            separator.nextUntil(".our-matryoshka-group-separator-container").toggleClass("our-matryoshka-group-separator--collapsed");
            
        });
    }

`

@ault
Copy link
Author

ault commented Jan 29, 2021

With help from @harry-gordon , by adding a bit of time to timeout.toggleCollapse function, it works (note the 1ms).

Not sure what the next steps would be.

$scope.toggleCollapse = function() {
            $timeout(function() {
                separator.toggleClass("our-matryoshka-group-separator--collapsed");
                separator.nextUntil(".our-matryoshka-group-separator-container").toggleClass("our-matryoshka-group-separator--collapsed");
            },1);
        }

@skttl
Copy link
Owner

skttl commented Feb 5, 2021

I added the timeout, and it works here too :) b27567b

@skttl skttl closed this as completed Feb 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants