[wp-trac] [WordPress Trac] #47131: Cursor suggests functionality even when functionality is not present
WordPress Trac
noreply at wordpress.org
Mon Sep 23 11:11:23 UTC 2019
#47131: Cursor suggests functionality even when functionality is not present
-------------------------------------+-------------------------------------
Reporter: anevins | Owner: antpb
Type: defect (bug) | Status: reviewing
Priority: normal | Milestone: 5.3
Component: Media | Version:
Severity: normal | Resolution:
Keywords: has-screenshots | Focuses: ui, accessibility,
wpcampus-report has-patch commit | javascript
-------------------------------------+-------------------------------------
Comment (by afercia):
Thanks all! Reviewing a bit the patch, a couple considerations:
- Targeting the h2 element with `find( 'h2' )` could expose to failure
with potential, future, changes in the markup. Wouldn't be safer to target
the `.ui-sortable-handle` class?
- I'd consider to add/remove a CSS class instead of using jQuery `.css()`
More importantly, the script doesn't update dynamically "draggability" and
cursor style when changing meta boxes visibility in the Screen Options. To
reproduce, for example:
- edit an attachment in the Edit Media page
- set 1 column in the Screen Options
- unset visibility for all the meta boxes
- the only visible meta box is Save with cursor: auto, which is correct
- in the Screen Options make one more meta box visible
- at this point there are two visible meta boxes and they should be
sortable
- instead, they can't be dragged and the cursor style is still auto
- refresh the page
- see that now the two meta boxes are sortable
I see there's a custom event `$document.trigger( 'postbox-toggled',
$postbox );` that could be used. Will try to update the patch.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/47131#comment:26>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list