Skip to content
Snippets Groups Projects
Verified Commit 64851733 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

fix: #201

parent ba9606dd
Branches
Tags
No related merge requests found
......@@ -20,7 +20,7 @@ import {
} from "../../dom/customelement.mjs";
import { CallButtonStyleSheet } from "./stylesheet/call-button.mjs";
import { isArray, isObject, isFunction } from "../../types/is.mjs";
import { getDocument } from "../../dom/util.mjs";
import {findElementWithSelectorUpwards, getDocument} from "../../dom/util.mjs";
import { ATTRIBUTE_PREFIX } from "../../dom/constants.mjs";
export { CallButton };
......@@ -200,7 +200,6 @@ function initOptionsFromArguments() {
* @throws {Error} The option references.callableSelector must be an array
*/
function initEventHandler() {
const doc = getDocument();
this[callButtonElementSymbol].addEventListener("click", (event) => {
event.preventDefault();
......@@ -218,7 +217,7 @@ function initEventHandler() {
}
for (const selector of selectors) {
const element = doc.querySelector(selector);
const element = findElementWithSelectorUpwards( this,selector);
if (element instanceof HTMLElement && isFunction(element?.[call])) {
element[call]();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment