From ed23aecfeb67837c6af43032cb553af4c263f62e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ella=20van=C2=A0Durpe?= Date: Thu, 26 Nov 2020 00:09:43 +0200 Subject: [PATCH] Fix media placeholder drag over state --- packages/components/src/drop-zone/provider.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/components/src/drop-zone/provider.js b/packages/components/src/drop-zone/provider.js index cb0649347d9315..38cab06bd92d4c 100644 --- a/packages/components/src/drop-zone/provider.js +++ b/packages/components/src/drop-zone/provider.js @@ -21,13 +21,16 @@ const { Provider } = Context; function getDragEventType( { dataTransfer } ) { if ( dataTransfer ) { - if ( getFilesFromDataTransfer( dataTransfer ).length > 0 ) { - return 'file'; - } - // Use lodash `includes` here as in the Edge browser `types` is implemented // as a DomStringList, whereas in other browsers it's an array. `includes` // happily works with both types. + if ( + includes( dataTransfer.types, 'Files' ) || + getFilesFromDataTransfer( dataTransfer ).length > 0 + ) { + return 'file'; + } + if ( includes( dataTransfer.types, 'text/html' ) ) { return 'html'; }