'Disable collapsing accordion when page is in state "CLOSED"
I´m struggling with solution to disable collapsible accordion, if the page in which the accordion is rendered is in state "CLOSED": The accordion is expanded by default and the goal is to have this accordion expanded without the possibility to collapse it if the page is in the state "CLOSED".
Do you have any suggestions?
This is the code using scale component
<scale-accordion expanded>
<scale-collapsible [disabled]="state === 'CLOSED'">
<span slot="heading">Some heading</span>
<p>Some text</p>
</scale-collapsible>
</scale-accordion>
Solution 1:[1]
meanwhile, I figured out the solution for my question:
ngOnInit(): void {
if (this.state === 'CLOSED') {
document.querySelector('scale-collapsible').style.pointerEvents = 'none';
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Victoria |


