Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#32236 closed defect (bug) (fixed)

Semantic elements for non-link links: media views buttons

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

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 11 years ago.

Download all attachments as: .zip

Change History (6)

@afercia
11 years ago

#1 @afercia
11 years ago

  • Keywords has-patch added

First pass patch.

#2 @wonderboymusic
11 years ago

  • Milestone Awaiting Review4.3
  • Owner set to wonderboymusic
  • Status newassigned

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

#3 @wonderboymusic
11 years ago

In 32464:

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

Props afercia.
See #32236.

#4 @wonderboymusic
11 years ago

  • Resolutionfixed
  • Status assignedclosed

Fixed, the rest of the work is in #26550

#5 @afercia
10 years ago

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