element-attribute decollission

check whether or not closest matching element is original element
This commit is contained in:
alfonsrv 2022-01-05 19:19:05 +01:00 committed by GitHub
parent e3abc3d7ac
commit d65b1aa5b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -127,10 +127,10 @@ return (function () {
function getClosestAttributeValue(elt, attributeName) {
var closestAttr = null;
getClosestMatch(elt, function (e) {
closestAttr = getAttributeValue(e, attributeName);
if (closestAttr) {
var inheritAttr = getAttributeValue(e, 'hx-inherit');
if (inheritAttr === 'false' || inheritAttr.includes(attributeName)) {
closestAttr = getAttributeValue(e, attributeName)
if (closestAttr && elt !== e) {
var inheritAttr = getAttributeValue(e, "hx-inherit");
if (inheritAttr && (inheritAttr === "false" || inheritAttr.includes(attributeName))) {
closestAttr = "unset";
}
}