Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menu bar items can't be removed by changing the config.menuBar.removeItems property in other plugins constructors #16326

Open
Dumluregn opened this issue May 8, 2024 · 0 comments
Labels
type:bug This issue reports a buggy (incorrect) behavior.

Comments

@Dumluregn
Copy link
Contributor

📝 Provide detailed reproduction steps (if any)

  1. Add the following line in any plugin constructor (e.g. FontSizeEditing):
editor.config.define( 'menuBar.removeItems', [ 'menuBar:bold' ] );
  1. Open any demo using the menu bar and the removed item, e.g. all-features ( yarn manual -f ckeditor5/all-features )
  2. Open menu Format=>Text.

✔️ Expected result

The "Bold" button is gone.

❌ Actual result

It's still visible.

❓ Possible solution

This happens because:

  1. Menu bar stores the config clone in the corresponding EditorUI plugin.
  2. This clone is created before the plugin initialization.
  3. Even if some plugin wants to change the menu bar config, it can't access the clone.

So currently, the only way to remove a menu bar item is doing so directly within the config passed to the editor creator function.

📃 Other details

  • Browser: …
  • OS: …
  • First affected CKEditor version: …
  • Installed CKEditor plugins: …

If you'd like to see this fixed sooner, add a 👍 reaction to this post.

@Dumluregn Dumluregn added the type:bug This issue reports a buggy (incorrect) behavior. label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

No branches or pull requests

1 participant