[wp-trac] [WordPress Trac] #49288: Metabox holders missing their border and "Drag boxes here" text

WordPress Trac noreply at wordpress.org
Tue May 26 13:35:16 UTC 2020


#49288: Metabox holders missing their border and "Drag boxes here" text
-------------------------------------+-------------------------------------
 Reporter:  xkon                     |       Owner:  audrasjb
     Type:  defect (bug)             |      Status:  reviewing
 Priority:  normal                   |   Milestone:  5.5
Component:  Administration           |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch has-           |     Focuses:  ui, accessibility,
  screenshots                        |  administration
-------------------------------------+-------------------------------------

Comment (by afercia):

 Aside: while working on this I noticed a pre-existing issue.

 With Chrome, when zooming out or in, at some zoom levels the "sortable
 placeholder" (the rectangle with a thin dashed border) has no height. It
 just shows like a doubled dashed line. See screenshot below.

 When the placeholder height isn't explicitly set via CSS, jQuery UI
 sortable is supposed to compute a height based on the dragged element. See
 https://github.com/jquery/jquery-ui/blob/1.11.4/ui/sortable.js#L816-L817
 This is a good thing because the placeholder will adapt to the post box
 collapsed / expanded height.

 However, seems this computation fails because Chrome returns a height
 value which is `0` with some decimals e.g. `0.02083400000000002` thus when
 the Sortable code checks for `! element.height()`, it fails. I guess
 jQuery UI sortable should prevent browser roundings by using `parseInt()`
 on all those values. Thinking this should be reported upstream. Although
 WordPress is using a pretty old version of jQuery / jQuery UI,
 [https://github.com/jquery/jquery-
 ui/blob/e7a10c70ae75c741992afdda60a433be205fd85e/ui/widgets/sortable.js#L953-L966
 this issue doesn't seem fixed on latest master as well].

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


More information about the wp-trac mailing list