WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#32236 closed defect (bug) (fixed)

Semantic elements for non-link links: media views buttons

Reported by: afercia Owned by: wonderboymusic
Milestone: 4.3 Priority: normal
Severity: normal Version: 3.5
Component: Media Keywords: has-patch semantic-buttons
Focuses: ui, accessibility, javascript Cc:

Description

All the buttons in the media views (wp.media.view.Button) are currently marked up as links with an attribute href="#" and they just "look" like buttons. For semantics and accessibility they should be buttons, see #26504

Thanks to backbone this would be a two-lines change but we should carefully check if anything breaks. Not 100% sure but to my understanding, given the way backbone attaches events, we should be safe. cc @wonderboymusic

Also, the modal menu items (wp.media.view.MenuItem) are links with an attribute href="#". See screenshot below.

https://cldup.com/JVdNgMCOxz.png

If we decide to keep them as links, then they should act like links and be integrated with the media router and browser history. Or, we can simply change them in buttons and consider them just as controls that "switch" the views. Open to suggestions, any thoughs more than welcome.

See related #26550 for the buttons in media-template.php

Attachments (1)

32236.patch (983 bytes) - added by afercia 4 years ago.

Download all attachments as: .zip

Change History (6)

@afercia
4 years ago

#1 @afercia
4 years ago

  • Keywords has-patch added

First pass patch.

#2 @wonderboymusic
4 years ago

  • Milestone changed from Awaiting Review to 4.3
  • Owner set to wonderboymusic
  • Status changed from new to assigned

This appears to work fine. Will drop it in and see what breaks.

#3 @wonderboymusic
4 years ago

In 32464:

wp.media.view.Button should create <button>s, not <a href="#">s.

Props afercia.
See #32236.

#4 @wonderboymusic
4 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed, the rest of the work is in #26550

#5 @afercia
3 years ago

  • Keywords semantic-buttons added
Note: See TracTickets for help on using tickets.