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

<detail> elements cannot be expanded without accordion plugin #3051

Open
wesley-at-hl opened this issue Jan 19, 2024 · 1 comment
Open

<detail> elements cannot be expanded without accordion plugin #3051

wesley-at-hl opened this issue Jan 19, 2024 · 1 comment

Comments

@wesley-at-hl
Copy link

wesley-at-hl commented Jan 19, 2024

📝 Provide detailed reproduction steps (if any)

✔️ Expected result

I can expand/collapse because that is native html behavior

❌ Actual result

Nothing happens.

❓ Possible solution

It does not make sense to suppress native behavior when the added behavior to make it work is optional, so it should be either

  • expand/collapse have native behavior if accordion plugin is not included (so the code to suppress native behavior should be part of the accordion plugin)
  • accordion plugin should be core behavior.
@TheSpyder
Copy link
Member

You haven't been able to click to toggle for many years in TinyMCE. The native behaviour of contenteditable=true is to toggle when clicking anywhere in the summary element, which is a terrible user experience. We can't detect whether that click is on the disclosure arrow, so we just block it completely.
https://codesandbox.io/p/sandbox/frosty-wood-d6n6g3

When we added the accordion plugin we removed some old code which added open to details elements. This does unfortunately mean that the details element is left in the browser default state, collapsed.

Perhaps our docs need to be improved. The details_initial_state and details_serialized_state options are core behaviours, but they're listed as plugin options with just a small note that they don't require the plugin. These can be used to expand details elements automatically.

@TheSpyder TheSpyder transferred this issue from tinymce/tinymce Jan 22, 2024
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

2 participants