Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

.close = Open and .open = Close? #11

Open
RafaelDeJongh opened this issue May 19, 2018 · 2 comments
Open

.close = Open and .open = Close? #11

RafaelDeJongh opened this issue May 19, 2018 · 2 comments

Comments

@RafaelDeJongh
Copy link

RafaelDeJongh commented May 19, 2018

This collapse module is pretty sweet, sadly it's a lacking a bit of functionality you'd expect in this kind of module. This was also one of the reasons I found this bug.

As there is currently only a "Toggle" functionality, not just an Open this one or Close that one, just toggle, I therefore had to write my own function to keep the tab open when an info button was clicked upon again if I wanted to avoid if clicking twice on the info button would toggle the collapse element.

alwaysOpen:function(){
	for(var i in this.$refs){
		if(true == this.$refs[i].status){
			this.$refs[i].close();
		}
	}
}

The following code was therefore also used, however note the .close() instead of .open() as I was troubleshootning for hours and litterly wasted a whole day to find out that the functionality to keep the tabs open was .close() instead of .open()!

I'm not sure why this is as I first started by using less complex code to just see if I could keep it open, but that didn't work either, so after almost giving up I just tried to use .close() and by the beard of odin this actually worked!

And well that's why I'm reporting this bug as it seems the functions are flipped or is there something else that's causing this?

I'm also looking forever now to add a class to the main div group when it's open as I want to properly set an active class to it so I can color code active ones, but even though I'm trying this with v-on:onStatusChange="activateClass" I can't seem to add a class to the element itself...

Would love to have some insight in this, but either way thanks for this quite lovely module!

@pndiogo
Copy link

pndiogo commented Mar 20, 2020

+1

@tbredin
Copy link

tbredin commented Jul 2, 2020

Having trouble figuring out how to add an active class somewhere as well

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants