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 | Owned by: | 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)
Change History (16)
#3
@
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
@
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.
#5
@
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
@
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
@
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
@
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.
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 theout
function accordingly.