Off canvas element needs to be clicked twice for closing

Hello there.
I have a strange issue here: I need to click twice on the close button (blue button underneath the text) of the RED off canvas element to hide it.
more strange issue: it happens only after loading the page the first time.

fun fact: it works just fine in the BLUE off canvas element. See button “später”.

Visiting a different page of the same site and coming back to the home page - all works just fine.

Why oh why…

Any hint very appreciated.
Thx a heap.
Details in the secure note.

Hey Ondrej,

Thanks for writing in! Regretfully we cannot check your site. The domain seems that it does not exist. Please se the screenshot in the secure note below and double-check it. By the way, does the issue happen after the updates? Make sure to clear your plugin caches and site cache before testing the site. This article might help you:

Best Regards.

dang. url corrected in the secure note in the first message.

I will never understand, why some folks just misuse a language or just randomly mix them up.

Hi Ondrej,

I have checked and found the Off Canvas is closing perfectly fine. Please check the following video link and add in to the secure note.

If that is not the case and you are trying to point out something else, please provide any screenshot marked with the issue or any video that helps us to recognize the problem.

Thanks

ok - i’m afraid I did not express myself properly:
It closes fine after the first attempt.

Otherway closing it the second time all’s just fine - I mean like returning from an other sub-page (going back in history as well) to the homepage - all’s perfect.

BUT: If you load the site the first time, you have to click it twice. I tested it on 3 different machines, 4 different browsers.

Hello Ondrej,

Please make sure that you have targeted the off-canvas element. I have replicated the issue in my local testing server and I found out that the custom attribute added to the Off-canvas is not reflected in settings the aria-hidden is still True as soon as you click the button, and the aria-hidden is now False and the next time you click, it closes. you have added the x-active to force the off-canvas to open once the page is loaded. You will need to run a JS code that watches for events when the off-canvas is loaded, it sets the aria-hidden to false because even the custom attribute aria-hidden=false is added to the off-canvas, as soon as the page loads, it is back to True.

Hope this explains it.

added to the Off-canvas is not reflected in settings <<

Pls could you tell me what “settings” do you mean?

Hi Ondrej,

As explained by my colleague, you need to set the aria-hidden to be True, and when the Off Canvas modal open, it changed to False and that is why the modal close while clicked. In your case, the modal opens when the page load but the aria-hidden is still set to True, and that is the problem. And as suggested by my colleague, you need to add a custom JavaScript code that runs when the page loads and set the aria-hidden value to False. If you are not proficient, I would suggest you hire a developer who can assist you to do the customization or you can avail of our newly launched service called TOTAL CARE, where we offer small customizations.

Thanks

Well using this script:

function functionAddAttribute(){
    document.getElementById('konsumenteninfo-off-canvas').setAttribute('aria-hidden', 'false');
};
window.onload = functionAddAttribute;

after reloading the page all instances of “aria-hidden” in the according code part are set to “false”. And sorry I missed to highlight one instance in the screengrab, which is set to “false” anyway.

The closing button sill has to be clicked twice. What am I missing?

Btw - I used the custom attribute based on this suggestion to keep the off canvas element open at load.

Hey Ondrej,

I have exhausted everything and I cannot seem to resolve this. It really needs to double-click on the button to be able to close the off-canvas. I will forward this to our developer for further investigation. They should be able to determine whether it is a bug or maybe suggest a simple way to do this.

Thank you for your understanding.

Thx a heap for your efforts in advance.

We’re happy to help in any way we can.

Yeah there is no way around this issue in the current version. This element in particular was never setup to be opened by default through x-active. In the next release this will be fixed and based on your page you shouldn’t have to do anything it’ll just work and close on the first click. Thanks for your patience.

Thank you very much! It’s not the version 6.1.2 though.(?)

EDIT: or is it? :smiley: :smiley: :smiley: looks fine so far!
Great! Thank you very much.

Yes latest or 6.1.5 as you have on your site. Awesome to hear, I checked it as well and it’s looking good. Have a great day!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.