Skip to content

Commit

Permalink
Fix first inserted widget drag-n-drop.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey.piskunov committed Apr 3, 2020
1 parent 258c8ec commit d4375ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/widget/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@
var id = getWidgetId( element );

// There's no need to check element parents if element is a wrapper.
if ( !checkWrapperOnly && !id ) {
if ( !checkWrapperOnly && !id && id !== 0 ) {
var limit = this.editor.editable();

// Try to find a closest ascendant which is a widget wrapper.
Expand Down Expand Up @@ -2633,7 +2633,7 @@

// Add support for dropping selection containing more than widget itself
// or more than one widget (#3441).
if ( !id && editor.widgets.selected.length > 0 ) {
if ( !id && id !== 0 && editor.widgets.selected.length > 0 ) {
evt.data.dataTransfer.setData( 'text/html', getClipboardHtml( editor ) );
return;
}
Expand Down

0 comments on commit d4375ba

Please sign in to comment.