Bug 1584988 - Only allow files to be dropped onto HAR overlay r=Honza

Differential Revision: https://phabricator.services.mozilla.com/D48982

--HG--
extra : moz-landing-system : lando
This commit is contained in:
David Walsh 2019-10-15 15:29:51 +00:00
parent 037581be8e
commit d920e3e85f
2 changed files with 12 additions and 0 deletions

View File

@ -51,6 +51,10 @@ class DropHarHandler extends Component {
onDragEnter(event) {
event.preventDefault();
if (event.dataTransfer.files.length === 0) {
return;
}
startDragging(findDOMNode(this));
}

View File

@ -232,6 +232,13 @@ define(function(require, exports, module) {
}
}
onMouseDown(event) {
// Prevents click-dragging the tab headers
if (event) {
event.preventDefault();
}
}
// API
setActive(index) {
@ -322,6 +329,7 @@ define(function(require, exports, module) {
"aria-selected": isTabSelected,
role: "tab",
onClick: this.onClickTab.bind(this, index),
onMouseDown: this.onMouseDown.bind(this),
},
title,
badge && !isTabSelected && showBadge()