Skip to content

Commit

Permalink
Fix DropZone class names on drop (WordPress#65798)
Browse files Browse the repository at this point in the history
Co-authored-by: ajlende <[email protected]>
Co-authored-by: jeryj <[email protected]>
Co-authored-by: tyxla <[email protected]>
  • Loading branch information
4 people authored and karthick-murugan committed Nov 13, 2024
1 parent b9b4132 commit 4e280cb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- `ToggleGroupControl`: indicator doesn't jump around when the layout around it changes ([#65175](https://github.com/WordPress/gutenberg/pull/65175)).
- `Composite`: fix legacy support for the store prop ([#65821](https://github.com/WordPress/gutenberg/pull/65821)).
- `Composite`: make items tabbable if active element gets removed ([#65720](https://github.com/WordPress/gutenberg/pull/65720)).
- `DropZone`: fix class names on drop ([#65798](https://github.com/WordPress/gutenberg/pull/65798)).

### Deprecations

Expand Down
3 changes: 1 addition & 2 deletions packages/components/src/drop-zone/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export function DropZoneComponent( {
setType( _type );
},
onDragEnd() {
setIsDraggingOverElement( false );
setIsDraggingOverDocument( false );
setType( undefined );
},
Expand All @@ -116,8 +117,6 @@ export function DropZoneComponent( {
( ( type === 'file' && onFilesDrop ) ||
( type === 'html' && onHTMLDrop ) ||
( type === 'default' && onDrop ) ),
'has-dragged-out': ! isDraggingOverElement,
// Keeping the following classnames for legacy purposes
'is-dragging-over-document': isDraggingOverDocument,
'is-dragging-over-element': isDraggingOverElement,
[ `is-dragging-${ type }` ]: !! type,
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/drop-zone/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
transform: scale(0.9);
}

&.is-active:not(.has-dragged-out) {
&.is-active.is-dragging-over-element {
.components-drop-zone__content {
opacity: 1;

Expand Down

0 comments on commit 4e280cb

Please sign in to comment.