Skip to content

Fix children of driver buttons not triggering click events #560

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jarikmarwede
Copy link
Contributor

Closes #559

Comment on lines +164 to +172
const parentsClassListsContain = (element: HTMLElement, parentClass: string): boolean => {
if (element.classList.contains(parentClass)) {
return true;
}
if (element.parentElement !== null) {
return parentsClassListsContain(element.parentElement, parentClass);
}
return false;
};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if there is an easier way to do this or if the function should be located somewhere else in the project. I put it here because it is only used in this file, but maybe it should move to utils.ts

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am trying to add a skip button using the following code:
The issue is that the Skip button is added, but the click event listener is not working. Can you also please check if this issue can also be addressed in your PR? Thank you.

`onPopoverRender: (popover) => {
const skipButtonContainer = document.createElement("div");
skipButtonContainer.classList.add('driver-popover-skip-btn-container');

const skipButton = document.createElement("button");
skipButton.innerText = "Skip";
skipButton.classList.add('driver-popover-skip-btn');

skipButtonContainer.appendChild(skipButton);
popover.footerButtons.appendChild(skipButtonContainer);

// Delay the event listener to ensure the button is fully rendered
setTimeout(() => {
  skipButton.addEventListener("click", () => {
    console.log("Skip button clicked");
  });
}, 0);

},`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@naren-innowell check this issue #565

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Children of footer buttons do not trigger click events
3 participants