Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Better assign aria-* attributes to interactive block elements #84

Open
admturner opened this issue Jan 17, 2024 · 0 comments
Open

Better assign aria-* attributes to interactive block elements #84

admturner opened this issue Jan 17, 2024 · 0 comments
Labels
code quality Better solutions to existing functionality enhancement New feature or request

Comments

@admturner
Copy link
Member

Is your suggestion related to a problem? Please describe.

Blocks that serve as event triggers need ARIA attributes and there is no clear way to do that at the block or template level. When I add attributes directly the block in a template it triggers a block error in the editor. There are two ways around this that I've found:

  1. Use the render_block filter to intercept specific blocks and filter the content using WP_HTML_Tag_Processor. This doesn't seem to work consistently for all blocks -- hidden elements appear to be ignored.
  2. Use JS to add the attributes.

Describe alternatives you have considered.

The current methods work alright, but there should be a more reliable, consistent, and performant method.

@admturner admturner added enhancement New feature or request code quality Better solutions to existing functionality labels Jan 17, 2024
@admturner admturner added this to the Future release milestone Jan 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
code quality Better solutions to existing functionality enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant