Accessibility issue for buttons
-
I like how the modal dialog is set up as a modal in the editor to better simulate the functionality that’ll be seen on the frontend, and the triggering ability on a few block elements including buttons is great too.
The main issue that is blocking me from using this plugin is that buttons set up to trigger opening a modal remain as empty link (
<a>) tags so they’re not included in the interactive elements that are highlighted when hitting tab on your keyboard.I was going to set up a demo page for this but then I noticed the exact issue I’m having is present on your demo page at https://light-modal-block.cloudcatch.io/. Try to get to any of the buttons with keyboard only to see what I mean. To fix this, you’d need to make sure the button is an actual
<button>and that the trigger modal attribute is on that button instead of the parent div.So changing this:
<div class="wp-block-button" data-trigger-modal="dY4TiQP8ZWX"><a class="wp-block-button__link wp-element-button">Open Modal</a></div>to something more like this:
<div class="wp-block-button"><button class="wp-block-button__link wp-element-button" data-trigger-modal="dY4TiQP8ZWX">Open Modal</button></div>The page I need help with: [log in to see the link]
The topic ‘Accessibility issue for buttons’ is closed to new replies.