Make WordPress Core

Opened 6 weeks ago

Closed 6 weeks ago

#64410 closed defect (bug) (reported-upstream)

Language dialog pops up twice; language chosen the first time not being applied.

Reported by: oldrup's profile oldrup Owned by:
Milestone: Priority: normal
Severity: normal Version: 6.9
Component: Editor Keywords:
Focuses: Cc:

Description

The Language / text direction selector, in the block editor, pops up twice when selected. If I enter a language code the first time, but not the second time, the <bdo> element inserted ends up having an empty language attribute. In other words, the selected language is not being applied, ending up with markup like this:

<p><bdo lang="" dir="ltr">I Danmark taler de fleste dansk</bdo></p>

I'm not sure whether that is by design, but I don't assume it is.

Can you reproduce?

Attachments (1)

language-popover.png (34.6 KB) - added by wildworks 6 weeks ago.
Language popover

Download all attachments as: .zip

Change History (8)

#1 @sabernhardt
6 weeks ago

  • Component changed from General to Editor
  • Milestone changed from Awaiting Review to 6.9.1

I can reproduce the behavior in 6.9, but not with Gutenberg 22.2.0 activated. It might have been fixed in the plugin already, but I did not find a related issue or PR in the Gutenberg repository (or its changelog).

#2 @wildworks
6 weeks ago

I was unable to reproduce the issue on 6.9. Is my testing procedure correct?

  1. Access https://playground.wordpress.net/?wp=6.9
  2. Open the initial post with the title Hello world!
  3. Select the word "WordPress"
  4. Click the "Language" button in the block toolbar
  5. The language popover opens
  6. Fill the Language field with en
  7. Click the Apply button
  8. The language popover closes
  9. Open the code editor
  10. Confirm that the bdo tag is applied correctly
<!-- wp:paragraph -->
<p>Welcome to <bdo lang="en" dir="ltr">WordPress</bdo>. This is your first post. Edit or delete it, then start writing!</p>
<!-- /wp:paragraph -->

@wildworks
6 weeks ago

Language popover

#3 @soyebsalar01
6 weeks ago

I tested this bug in my environment but also unable to reproduce same as @wildworks .
See the below image for verify :
https://ibb.co/cch9mQF7

#4 @oldrup
6 weeks ago

@wildworks Yes, that is the procedure; however, I'm getting different results.

After step 7, clicking the apply button, the dialog closes and immediately reopens, with the language field empty. If I just click apply again, the <bdo> element is added with an empty language attribute.

I made a quick screencast to illustrate my results.

https://oldrup.dk/wp-content/uploads/2025/12/language-popup-twice.mp4

This is how it works on all the WP 6.9 installations I've tested it on. On WP 6.8, the dialog is only shown once (my attempt to rule out a browser issue)

#5 @wildworks
6 weeks ago

@oldrup Thanks for the reply. I discovered that this issue cannot be reproduced in Chrome, but can be reproduced in Firefox. Right?

#6 @oldrup
6 weeks ago

@wildworks Ah, confirmed; tested on WordPress Playground in Chrome and Firefox 146 in incognito/private mode (no extensions activated)

✅In Chrome it works as expecte
⚠️In Firefox the dialog is shown twice, the second time with an empty language field.

I've tested in Firefox on two different computers and on numerous websites, including WP 6.8 sites, where I don't have this issue.

#7 @wildworks
6 weeks ago

  • Milestone 6.9.1 deleted
  • Resolution set to reported-upstream
  • Status changed from new to closed

Thanks, everyone. Let's continue investigating this issue in the Gutenberg repository.

https://github.com/WordPress/gutenberg/issues/74000

Note: See TracTickets for help on using tickets.