Hi
I’ve posted this question in Velo forum too, but it seems like an issue with editor x.
Due to accessibility issues with the FAQ widget from Wix , I’ve created this page in this one year old site. I had to build it from scratch using code (attached down below).
I’ve found a code online that seems to work fine. The only problem is that the user has to click twice on the open / close button in order for it to work. I thought it was a problem with the code, so I asked the Velo forum, and it’s not that.
I’ve copied the elements and the code to a different editor X site, and the problem still occurs, but when I copy everything to a classic editor site, everything works as expected.
That leads me to believe that this is a bug in editor x.
What should I do in this case?
Thanks
Tal
$w . onReady ( function () {
$w ( ‘#collapsedelement’ ). collapse ();
$w ( ‘#closebtn’ ). hide ();
});
export function openbtn_click ( event ) {
let $item = $w . at ( event . context );
if ( $item ( "#collapsedelement" ). collapsed ) {
$item ( "#collapsedelement" ). expand ();
$item ( '#openbtn' ). hide ();
$item ( '#closebtn' ). show ();
} **else** {
$item ( "#collapsedelement" ). collapse ();
$item ( '#openbtn' ). show ();
$item ( '#closebtn' ). hide ();
}
}
export function closebtn_click ( event ) {
let $item = $w . at ( event . context );
if ( $item ( "#collapsedelement" ). collapsed ) {
$item ( "#collapsedelement" ). expand ();
$item ( '#openbtn' ). hide ();
$item ( '#closebtn' ). show ();
} **else** {
$item ( "#collapsedelement" ). collapse ();
$item ( '#openbtn' ). show ();
$item ( '#closebtn' ). hide ();
}
}