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

An empty style_formats should hide the option in the contextmenu #9534

Open
mparpaillon opened this issue Apr 5, 2024 · 0 comments
Open

Comments

@mparpaillon
Copy link

📝 Provide detailed reproduction steps (if any)

Use style_formats with style_formats_autohide set to true. For instance

contextmenu: "styles",
style_formats_autohide: true,
style_formats: [
  {
    title: "Image Left",
    selector: "img",
    classes: ["floatLeft"],
  },
  {
    title: "Image Right",
    selector: "img",
    classes: ["floatRight"],
  },
  {
    title: "Bordered",
    selector: "img",
    classes: ["bordered"],
  },
],

✔️ Expected result

No context menu should open as no option are available for this target

❌ Actual result

With the configuration above, right clicking on anything (even not an image) will show the contextmenu with an empty broken "Formats" list (see screenshot below)

Capture d’écran 2024-04-05 à 14 28 12

❓ Possible solution

We should hide the "Formats" option from the contextmenu if none is available for the current target

📃 Other details

  • Browser: Version 123.0.6312.107
  • OS: MacOS 14.3.1
  • Affected version: 6.8.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant