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 10, 2024 at 10:02 am

lucap-5

Background of the issue:
I have added a language switcher block just after a menu on my site hidden link. I would like to have it on the right of the menu.

Symptoms:
The language dropdown appears below the menu instead of to the right.

Questions:
How can I position the language switcher to the right of the menu?

June 10, 2024 at 10:54 am
June 10, 2024 at 11:00 am #15721583

Waqas Bin Hasan
Supporter

Languages: English (English )

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

Hi,

Reference to our recent chat, please provide me access to the staging site as discussed.

Your next answer will be private, to share this information safely.

IMPORTANT: Please take a complete backup of the site to avoid data loss. I may need to activate/deactivate plugins also.

See https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/ for details on privacy and security.

Regards.

June 13, 2024 at 5:46 am #15734103

lucap-5

I managed to put it in the right side, but there is something weird in the switcher behaviour: it doesn’t close as it should.

If I click on it and then click on another menu item, the language drop-down is still open.
See hidden link

How can I make it close when clicking another menu item?

June 13, 2024 at 7:13 am #15734427

Waqas Bin Hasan
Supporter

Languages: English (English )

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

Thank you for the updates.

IMO, that's not a WPML problem but more of a design issue. You'd need to investigate your design (i.e. CSS and JS involved in this) and fix accordingly.

I'll recommend checking the following guides as a clue about fixing CSS problems with the language switcher:

- https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/custom-language-switcher/#the-styling-part
- https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/how-to-fix-styling-and-css-issues-for-the-language-switchers/

June 14, 2024 at 1:59 pm #15740398

lucap-5

It might be a CSS/JS issue, but I think is strictly WPML related.

I have changed the template to the default Twenty24, with no custom code whatsoever, and the issue is still there. The issue is related to how the language switcher blocks works.

When "open on click" is selected, after the click the dropdown stays there, even if the user clicks elsewhere...

See hidden link

Screenshot 2024-06-14 at 15.58.51.png
June 18, 2024 at 7:55 am #15747750

Waqas Bin Hasan
Supporter

Languages: English (English )

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

I need to take a closer look at your site. So I request temporary access (WP-Admin and FTP), preferably to a test/staging site where the problem has been replicated.

Your next answer will be private, to share this information safely.

Also provide detailed steps to reproduce the issue and links to pages in admin and on frontend.

IMPORTANT: Please take a complete backup of the site to avoid data loss. I may need to activate/deactivate plugins also.

See https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/ for details on privacy and security.

June 18, 2024 at 12:11 pm
June 18, 2024 at 2:16 pm #15749506

lucap-5

Thank you.

I have created a menu on the this staging page (hidden link) with a menu where the issue is visible: hidden link

June 19, 2024 at 7:35 am #15753557

Waqas Bin Hasan
Supporter

Languages: English (English )

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

Thank you for the access and the updates, I'm off today but 'll look into the matter tomorrow at earliest and 'll get back to you accordingly.

Thanks again for your patience and cooperation.

June 20, 2024 at 6:59 am #15761554

Waqas Bin Hasan
Supporter

Languages: English (English )

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

Thank you for your patience, I am checking for the said issue and can see that it can be reproduced with even a default WP theme (i.e. 2024).

But I am wondering where can I add/edit/remove this Language switcher, while I've turned off all switchers in WPML -> Languages (see attached).

Please write me the steps about the above mentioned, so I can further investigate it.

Screenshot 2024-06-20 115719.jpg
Screenshot 2024-06-20 115646.jpg
June 20, 2024 at 7:41 am #15761794

lucap-5

Hi Waqas, thank you for your support.

I am using the language switcher block that allows to add a language switcher in different part of a page, without having to do anything in the WPML>Languages page.

To remove it, you can delete it as a regular block.

Screenshot 2024-06-20 at 09.40.56.png
Screenshot 2024-06-20 at 09.40.49.png
Screenshot 2024-06-20 at 09.38.38.png
Screenshot 2024-06-20 at 09.38.26.png
Screenshot 2024-06-20 at 09.38.17.png
June 20, 2024 at 9:42 am #15762569

Waqas Bin Hasan
Supporter

Languages: English (English )

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

Thank you for the details.

I tried again with default 2024 theme and Astra (parent) theme but I can only find "Language Switcher" block by WPML. But can't find that "Navigation Language Switcher" block as you showed in this screenshot at https://wpml.org/wp-content/uploads/2024/06/15761794-Screenshot_2024_06_20_at_09.38.38.png.

However, I tried with WPML's language switcher block on a new test page, as well as, in the contact page, please see my screencast hidden link

You can also see that there's an option in the block settings to make it dropdown either on a click or on mouse over. When you set it to click, you need to click it again to collapse it.

If you think that the above mentioned isn't what you're looking for, then please write detailed steps about how can I find, add and edit that particular block? Also do I need any particular theme or plugin? Please note that current I checked with only WPML active and with 2024 + Astra themes and on the contact page your designated switcher block was present (which however is now overwritten, so please create a new page and show me how you're adding it).

June 20, 2024 at 9:52 am #15762604

lucap-5

Yes, it's the WPML language switcher block, that is ok.

I am aware of the option to make it drop down on hover, but unfortunately it's not how it must behave. It should display the dropdown on click, but the behaviour of the dropdown should work correctly: if you click outside or on another menu, the dropdown should close, but it doesn't.

That is the part I'd like to be fixed.

June 20, 2024 at 11:06 am #15763145

Waqas Bin Hasan
Supporter

Languages: English (English )

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

Thank you for the updates and your cooperation.

I've escalated the issue to our 2nd tier team and 'll get back to you as soon as there's some progress.

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.