Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
When using Language Switcher block as dropdown and set for open on click, it doesn't closes itself when clicking elsewhere on the page.

Solution:
Our team has identified the issue and has offered a workaround in this errata: https://wpml.org/errata/language-switcher-block-not-closing-on-page-click/

If this solution does not resolve your issue or seems irrelevant due to being outdated or not applicable to your case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, please open a new support ticket at WPML support forum.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: ,

This topic contains 28 replies, has 2 voices.

Last updated by Waqas Bin Hasan 3 months, 1 week ago.

Assisted by: Waqas Bin Hasan.

Author Posts
June 27, 2024 at 6:47 am #15840999

lucap-5

Is there any news on this?

June 27, 2024 at 8:40 am #15841905

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Unfortunately there's no ETA so far, however the issue is being reviewed by the 2nd tier team.

I 'll update you as soon as there's a progress.

We appreciate your patience and cooperation in this matter.

July 5, 2024 at 1:06 pm #15898687

lucap-5

Any news on this?

I tried to fix it but I couldn't, but I did not think that this issue was going to prove too difficult to fix for WPML itself..!

July 8, 2024 at 7:26 am #15910503

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and our apologies for the delay. I am checking with the relevant team and 'll get back to you soon on this.

July 8, 2024 at 9:06 am #15911363

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation.

Team suggests to use a plugin like WP Code and add a JS Snippet loaded inside the Footer:

let ls_block_switcher = document.querySelector(".wp-block-navigation-submenu__toggle");
let ls_block_open = ls_block_switcher.getAttribute('aria-expanded');

if (ls_block_open) {
    document.addEventListener('click', function(event) {
        if (!ls_block_switcher.contains(event.target)) {
            ls_block_switcher.setAttribute('aria-expanded', 'false');
        }
    });
}

Please try this and let me know.

July 8, 2024 at 11:42 am #15912747

lucap-5

Hi Waqas,
thank you for your support.

I have added the code, but nothing changes, the issue is still there: hidden link

I have tried to add the code provided in different positions, but it does not seem to work...

Screenshot 2024-07-08 at 13.41.41.png
Screenshot 2024-07-08 at 13.39.43.png
July 8, 2024 at 2:21 pm #15913899

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates.

I tried to login to your staging site but that seems to no longer exist. My sandbox site has also been expired.

However, I've informed the team and 'll get back to you accordingly. On the other hand, the issue has also been further escalated to the dev team.

July 8, 2024 at 2:29 pm #15913983

lucap-5

Thank you for the update Waqas. The staging site now is at hidden link
You should be able to login with your previous password

July 9, 2024 at 3:57 am #15917070

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

I'm getting the following error while trying to login to /stage7/:

Error: Invalid username/email or incorrect password.

I've enabled your next reply as private again to provide updated login information for the staging site.

July 9, 2024 at 6:09 am
July 9, 2024 at 6:10 am #15917961

lucap-5

Sorry about that, I have just updated the access credentials.

July 9, 2024 at 7:00 am #15918292

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates, I've informed our team and 'll get back to you accordingly.

July 10, 2024 at 5:43 am #15925549

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

I'm trying to check the fix applied but noticed that one of your parent theme is broken. So in an effort to fix it, I tried to install and activate Astra theme from Plugins -> Add New.

But site ran into a critical error and isn't accessible anymore.

Please connect via FTP and remove the "Astra" theme folder, so it can be accessible again.

After that, please check your themes page and scroll down to the bottom to find the notice about the broken theme. Please also fix that and let me know, so I can then proceed further.

July 10, 2024 at 6:09 am #15925720

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

I further tested in a new sandbox site (hidden link) and this seems to work just fine. You can access the sandbox and observe accordingly at hidden link (one-click login).

So I think the problem is somewhere with your theme which is perhaps a modified one. As well as its parent is broken.

Please check with standard Astra theme.

July 10, 2024 at 7:41 am #15926246

lucap-5

Thank you Waqas.

I think it has something to do with Astra theme. I have added a language switcher inside hidden link and, if set to "click", it does not work on your test site either.

But, if I switch the theme to TwentyThree, the language switcher works fine.

lucap-5 confirmed that the issue was resolved on 2024-07-10 11:52:19.
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.