Comments (3)
Hey @jenstornell
Well, I understand what happens here. When you set data-toggle-is-active
on a trigger, I do not toggle but add classes. So here, you will have the two classes flex hidden
on the first panel, and so, when you click on another trigger, those two classes are toggled, so removed, and the default display
value is kept. Logical.
Actually, that's why I said in the documentation:
In this case, you should add the specified class name on each element, even if the script will check that for you.
In your example, I guess you should only toggle the flex
class, so set data-toggle-class-on-target="flex"
, and it works.
But wellโฆ your example makes me think. Maybe I should really toogle classes instead of adding them for triggers that are active by default.
What do you think?
from easy-toggle-state.
Hey @jenstornell
I thought about this a little bit longer, and it came to me that since we are now able to toggle as many classes as we want, the adding instead of toggling classes on active by default triggers doesn't make sence anymore.
I will change that behaviour.
from easy-toggle-state.
Hey @jenstornell
It's now fixed! Using data-toggle-is-active
attribute to set a trigger and its targets as active by default will toggle them once on initialization as a consequence.
More information here: https://github.com/Twikito/easy-toggle-state/releases/tag/v1.15.0
from easy-toggle-state.
Related Issues (20)
- Can you target multiple elements? HOT 3
- Allow multiple triggers to modify a single toggle-able node HOT 5
- Multiple targets with different classes? HOT 6
- Programmatic Toggling HOT 5
- Toggling inputs HOT 10
- data-toggle-target-parent="" doesnt work with data-toggle-group=""? HOT 2
- Codepen example for simple tabs doesn't work HOT 1
- Add a default state attribute for target elements HOT 2
- Triggers don't work when loaded via XHR HOT 1
- data-toggle-trigger-off elements do not unbind HOT 1
- Toggles that target elements with data-toggle-trigger-off in them hijack focus on data-toggle-escape/data-toggle-outside
- Sample in Blazor ?
- Different class on trigger and target? HOT 10
- Toggle tabs from a select box HOT 1
- Using data-toggle-outside with a trigger containing another tag HOT 3
- Possible to work on hover? HOT 1
- Data-Toggle-Trigger-Off Not Working With CSS Selectors HOT 5
- Feedback HOT 2
- Browser support HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easy-toggle-state.