Don't prevent default click events when clicking input elements (close #7828)

This commit is contained in:
Quincy Morgan
2020-07-22 09:48:00 -04:00
parent 28178a7da8
commit 4643caaae8

View File

@@ -66,10 +66,14 @@ export function uiInit(context) {
// some targets have default click events we don't want to override
var isOkayTarget = d3_event.composedPath().some(function(node) {
// clicking <label> affects its <input> by default
return node.nodeName === 'LABEL' ||
// we only care about element nodes
return node.nodeType === 1 &&
// clicking <input> focuses it and/or changes a value
(node.nodeName === 'INPUT' ||
// clicking <label> affects its <input> by default
node.nodeName === 'LABEL' ||
// clicking <a> opens a hyperlink by default
node.nodeName === 'A';
node.nodeName === 'A');
});
if (isOkayTarget) return;