Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#30998 closed defect (bug) (fixed)

Widgets helper position incorrect after moving out of the sidebar

Reported by: alexvorn2's profile alexvorn2 Owned by: ocean90's profile ocean90
Milestone: 4.2 Priority: normal
Severity: normal Version: 4.2
Component: Widgets Keywords: has-patch dev-feedback
Focuses: Cc:

Description

How to replicate:
1) drag a widget to the sidebar in the widgets.php page without dropping on the sidebar
2) move the helper (widget clone) to somewhere else, moving out of the sidebar and you will see that the helper is in far from the mouse cursor.

Current version: 4.2-alpha-31007-src
The bug is present in the 4.1 version too.

Chrome 39.0.2171.95 m version, Windows 7 32bit.

I uploaded a video with my camera on youtube of the screen of my pc where I show the problem - https://www.youtube.com/watch?v=WzKMaY0VhNg

Attachments (2)

patch_30998.diff (605 bytes) - added by utkarshd_42 10 years ago.
patch removes the ui.item altogether when exiting sortable widet list
30998.patch (1.6 KB) - added by tyxla 10 years ago.
Cloning and removing the list group item as in jQuery UI 1.11.1

Download all attachments as: .zip

Change History (16)

#1 @utkarshd_42
10 years ago

  • Keywords has-patch dev-feedback added

In the above case we can remove the widget from the class altogether. That's what I have done in the above patch. Alternatively we can also set the position of ui.item to the current mouse position, just have to edit the out function accordingly.

@utkarshd_42
10 years ago

patch removes the ui.item altogether when exiting sortable widet list

#2 @SergeyBiryukov
10 years ago

  • Milestone changed from Awaiting Review to 4.2

#3 @tyxla
10 years ago

@utkarshd_42 your patch is not working for me. With it I am unable to drop any widget in any of my sidebars anymore.

Also, this basically hides the ui helper from view, which does not make much sense if the user is trying to drag it in a different sidebar from the one that they first rolled over.

#4 @tyxla
10 years ago

I had some investigation to diagnose where the issue comes from. I concluded that it occurred together with the update to jQuery UI 1.11.2.

I was able to isolate the piece of code that is responsible for the issue, so I'm providing here the code in the older version of the UI (1.11.1) which fixes the issue.

Basically, in 1.11.2 the creation of a clone of the list group item was removed, which was done in 1.11.1 and worked pretty well.

Since modifications to external libraries are not recommended, I can suggest that we send this one upstream to the jQuery UI developers.

@tyxla
10 years ago

Cloning and removing the list group item as in jQuery UI 1.11.1

#5 @utkarshd_42
10 years ago

@tyxla my bad.. I failed to safely remove the ui.item

      out: function( event, ui ) {
              if ( ui.helper != undefined ) {
                   ui.item.remove();
              }

A better way. Doesn't remove the ui.item if it has been dropped inside a sortable.

does not make much sense if the user is trying to drag it in a different sidebar from the one that they first rolled over.

I completely agree with you. But as you said in your earlier comment that we can't simply edit the draggable.js . I'm trying to find a workaround for it. Let's see if anything else works out.

#6 @utkarshd_42
10 years ago

I was thinking whether we can clone the ui.item somehow and then set the new item's position to our current mouse pointer, while removing the old one. Will something like this solve the above issue?

#7 @alexvorn2
10 years ago

if we can't patch this maybe to replace the all jquery files with older version that works? and after some time to update to the latest one... I think the WordPress team released version 4.1 to early without too much testing of the new jquery library.

This ticket was mentioned in Slack in #core by drew. View the logs.


10 years ago

This ticket was mentioned in Slack in #core by drew. View the logs.


10 years ago

This ticket was mentioned in Slack in #core by drew. View the logs.


10 years ago

This ticket was mentioned in Slack in #core by ocean90. View the logs.


10 years ago

#12 @scott.gonzalez
10 years ago

This is jQuery UI ticket #10669, which was fixed in d8077dc. I guess I missed this when I was preparing the 1.11.3 release.

This ticket was mentioned in Slack in #core by scott.gonzalez. View the logs.


10 years ago

#14 @ocean90
10 years ago

  • Owner set to ocean90
  • Resolution set to fixed
  • Status changed from new to closed

In 31716:

Update jQuery UI to 1.11.4.

Changelog:

props scott.gonzalez for arranging this release.
fixes #31597, #30998.

Note: See TracTickets for help on using tickets.