Skip to content
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

How can I do something on the popover #350

Closed
yokiizx opened this issue Dec 7, 2022 · 2 comments
Closed

How can I do something on the popover #350

yokiizx opened this issue Dec 7, 2022 · 2 comments

Comments

@yokiizx
Copy link

yokiizx commented Dec 7, 2022

I haven't seen an api that can be used after the popover visible.
I want to add some doms and add addEventListenr on them, but when step changed, it will be losing efficacy

@yokiizx yokiizx changed the title How can I How can I do something on the popover Dec 7, 2022
@mlisowsk
Copy link

mlisowsk commented Dec 7, 2022

You can specify an event listener for onHighlighted. It will be called after the focused Element is highlighted and the popover shown.
Do you plan to manipulate the highlighted element or the popover or some unrelated element?

Keep in mind that if you manipulate the DOM and change the layout you will need to call driver.refresh() to reposition the stage and popover.

If you addEventListener in onHighlighted you should also removeEventlistener that listener in the onDeselected handler.

@kamranahmedse
Copy link
Owner

We just released v1.0 of driver.js which has been rewritten from the ground up. It gives you more control over the popup DOM using onPopoverRender hook. Please have a look at the docs and do let me know if you face any issues.

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

No branches or pull requests

3 participants