WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.57k stars 4.22k forks source link

Add support for 'name' attribute of 'details' block. #62251

Open sfadschm opened 6 months ago

sfadschm commented 6 months ago

What problem does this address?

The details block is currently lacking support for its name attribute.

Spec.: https://html.spec.whatwg.org/multipage/interactive-elements.html

The attribute is supported in all recent browsers (except Firefox, god knows why...): https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details

While the "accordion-like" functionality supplied by the attribute might be misleading, the details block should still aim to support all HTML attributes defined in the spec, see also https://github.com/WordPress/gutenberg/issues/21584#issuecomment-1910899417_.

What is your proposed solution?

Add the "name" attribute to the block settings.

t-hamano commented 6 months ago

Thanks for the report.

56971 has been submitted to resolve this issue, but as you say, this attribute is not yet supported in Firefox, which is why the PR cannot be merged.

sfadschm commented 6 months ago

Oh, I do not understand how I did not find these in the search, sorry... Thanks for linking the PR.

dogee commented 1 month ago

@t-hamano Just a reminder that Firefox finally added the support for name attribute in its 130 version released in September. So I think the #56971 can be merged ASAP.

Thanks for your understanding.