You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
716 B
22 lines
716 B
"use strict"; |
|
|
|
Object.defineProperty(exports, "__esModule", { |
|
value: true |
|
}); |
|
exports.isLabelWithInternallyDisabledControl = isLabelWithInternallyDisabledControl; |
|
|
|
var _isDisabled = require("./isDisabled"); |
|
|
|
var _isElementType = require("./isElementType"); |
|
|
|
// Absolutely NO events fire on label elements that contain their control |
|
// if that control is disabled. NUTS! |
|
// no joke. There are NO events for: <label><input disabled /><label> |
|
function isLabelWithInternallyDisabledControl(element) { |
|
if (!(0, _isElementType.isElementType)(element, 'label')) { |
|
return false; |
|
} |
|
|
|
const control = element.control; |
|
return Boolean(control && element.contains(control) && (0, _isDisabled.isDisabled)(control)); |
|
} |