[FIX] mail: dropzone deactivate for text and user's avatar

Before this commit:

Currently, in Discuss, the chat activates the drop zone when try to drag and
drop any user's avatar (or any text). The same thing happens if we do it in
the chat window or chatter.

After this commit:

The chat will not be activated drop zone if the drag is not actually
a file/a document.

Task-2590510

closes odoo/odoo#80464

X-original-commit: 0e2f46bc2cfd36dc3508a56601239c15e2301571
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
Hiral Bhavsar
2021-11-26 16:42:10 +00:00
parent 8f546bfad1
commit 8ca8a38bb2
@@ -62,7 +62,11 @@ export function useDragVisibleDropZone() {
* @param {DragEvent} ev
*/
function _onDragenterListener(ev) {
if (dragCount === 0) {
if (
dragCount === 0 &&
ev.dataTransfer &&
ev.dataTransfer.types.includes('Files')
) {
isVisible.value = true;
}
dragCount++;