[wp-trac] [WordPress Trac] #34816: Theme Delete Button: (Prevent this page from creating additional dialogs)

WordPress Trac noreply at wordpress.org
Thu Dec 31 18:22:07 UTC 2015

#34816: Theme Delete Button: (Prevent this page from creating additional dialogs)
 Reporter:  emiluzelac               |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  4.5
Component:  Themes                   |     Version:  4.3.1
 Severity:  normal                   |  Resolution:
 Keywords:  good-first-bug has-      |     Focuses:  ui, accessibility,
  patch has-screenshots              |  javascript
Changes (by afercia):

 * focuses:  ui => ui, accessibility, javascript


 I'd suggest to have a look at what was done for the `wp-embed-share-
 dialog`, see the aria role "dialog", the aria-label attribute used on the
 modal container, focus handling and constraining tabbing.
 - when opening the modal, focus should be moved to the modal: probably
 making the container itself focusable since this modal doesn't contain
 just form elements but also text that needs to be made available to
 assistive technologies
 - maybe add a Close button on the top right, in this case this should be
 the first element to receive focus
 - when opening the modal, a CSS class `modal-open` should be added to the
 body and then removed when closing the modal
 - pressing Escape should close the modal
 - when closing the modal, focus should be moved back to the "Delete"
 - tabbing should be constrained within the modal
 - the "Cancel" link without a `href` attribute is not focusable, should be
 a button with a `type="button"` attribute
 - I'd consider to place the primary button on the left
 - maybe `event` should be explicitly passed to `deleteTheme`
 - when pressing OK to confirm the deletion, focus should be moved back to
 the most logical place (not sure where actually, maybe making the "Theme
 deleted" notice focusable)
 - I'm probably missing something :)

 There are several modal dialog used in the admin, each one with its own
 implementation, duplicated code sometimes, just a few modals have a
 sufficient level of accessibility. Sooner or later we should probably
 standardize all the modal dialogs an have a sort of mini "Modal API".

Ticket URL: <https://core.trac.wordpress.org/ticket/34816#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list