@testing-library/user-event
Version:
Fire events the same way the user does
21 lines (17 loc) • 622 B
JavaScript
var isClickableInput = require('../click/isClickableInput.js');
var isEditable = require('../edit/isEditable.js');
/**
* Determine if the element has its own selection implementation
* and does not interact with the Document Selection API.
*/ function hasOwnSelection(node) {
return isElement(node) && isEditable.isEditableInputOrTextArea(node);
}
function hasNoSelection(node) {
return isElement(node) && isClickableInput.isClickableInput(node);
}
function isElement(node) {
return node.nodeType === 1;
}
exports.hasNoSelection = hasNoSelection;
exports.hasOwnSelection = hasOwnSelection;
;