[wp-trac] [WordPress Trac] #32740: Menu Customizer: "quick delete" focus

WordPress Trac noreply at wordpress.org
Sun Jun 21 14:40:35 UTC 2015


#32740: Menu Customizer: "quick delete" focus
--------------------------+--------------------------------------------
 Reporter:  afercia       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  4.3
Component:  Customize     |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:  ui, accessibility, javascript
--------------------------+--------------------------------------------

Comment (by afercia):

 Testing with a menu with 3 items, their IDs are: 2623, 2625, 2626. Please
 refer to the screenshot below, where in `_setupRemoveUI` I'm just printing
 to the console the prev and next items: `console.log(
 control.container.prev(), control.container.next() );`

 First scenario:
 deleting the items in order from the first to the last one. As you can
 see, when deleting 2625, the previously deleted item is still returned
 even if it was just deleted. Same when deleting the last one 2626. In this
 last case it will try to set focus on the previous item which doesn't
 exist any more in the DOM. Focus is lost.

 Second scenario:
 deleting the second item and then the first item: at this point will
 return 2625 as "next" but that item was just removed from the DOM. Focus
 is lost.

 Things get a bit more complicated when you've just added new menu items to
 the menu.

 Sorry I'm not so familiar with the Customizer to get exactly what's
 happening here, I just suspect `debouncedReflowMenuItems()` added here
 https://github.com/voldemortensen/menu-
 customizer/commit/a9d502b31f3f96758287390fa225e48959e274c6 has something
 to do with this.

 [[Image(https://cldup.com/0ziM0dVVjg.png)]]

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32740#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list