-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Active State after 'openOnInit' #58
Comments
Hi @marianohsn .ac-trigger:focus {
color: $color-grey;
} If you want to apply styles also when the element is active, you need to edit this fragment: &.is-active {
.ac-panel {
visibility: visible;
}
& > .ac-header .ac-trigger {
// TRIGGER STYLES <--
&::after {
content: '\2013';
}
}
} |
Hello @michu2k - Thank you for your reply Shouldn't the Otherwise, I could try simulating a click, or altering the style of the expanded header via JS. |
I checked the official W3 accordion demo and it looks like they are doing exactly the same, applying styles to the currently focused element. I would say that using the same styles for the focus state and the open state can be a bit confusing for someone who uses Tab for navigation.
You can just add an additional className and manage the styles via CSS or modify |
I'm passing the option:
openOnInit: [2]
in order to show the third accordion item expanded by default, but its corresponding header/button's style remains in collapsed state.How can I make the header style change accordingly to expanded state when using
openOnInit: []
?Incorrect state of third header after being triggered by
![Screen Shot 2023-02-21 at 10 58 21 AM](https://user-images.githubusercontent.com/68350580/220423443-6763d0fe-03ed-4b62-b150-4c595a49beb9.jpg)
openOnInit: [2]
:Correct state of third header after being triggered by user click:
![Screen Shot 2023-02-21 at 10 58 28 AM](https://user-images.githubusercontent.com/68350580/220423680-1c68df66-d66e-4b17-b80b-8bed1330eda0.jpg)
The text was updated successfully, but these errors were encountered: