Skip to content

Selected language in custom code block doesn’t correctly update #2041

@andrictham

Description

@andrictham

Describe the bug
Since the custom code block was updated to use the block specs API (f28cdc2), the language selector has been broken.

Switching languages work (in that the syntax highlighting changes, and both the editor JSON and exported Markdown is properly updated to the right language), but the selector doesn’t show the currently selected language (unless the option is selected once more).

It wasn’t broken before updating to v0.39.0. This issue is still present in v0.39.1.

This bug is visible in the example shown in the docs, on both of these pages:

  1. Built-in Blocks / Code Blocks
  2. Examples / Theming / Custom Code Block Theme & Language

To Reproduce

  1. Go to the example in the docs, here.
  2. Click on the language selector, and change the language. Change it to "Vue", to observe that the syntax highlighting updates, but the selected language in the dropdown does not update, and still says "TypeScript"
  3. Click on the language selector again, and select "Vue" one more time. This time, it does update.

Misc

  • Tested on these browsers:
    • Chrome 140.0.7339.214 (arm64, macOS 26 Tahoe)
    • Safari 26.0 (21622.1.22.11.14, macOS 26 Tahoe)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions