kamranahmedse / driver.js

A light-weight, no-dependency, vanilla JavaScript engine to drive user's focus across the page
https://driverjs.com
MIT License
22.66k stars 1.01k forks source link

onPopoverRender not being called? #503

Closed troniousVMgr closed 3 months ago

troniousVMgr commented 3 months ago

I'd like to customize the popover itself a bit and per the documentation it seems that I should be able to hook into the onPopoverRender event

That being said, it's not being called? Not sure if I'm missing something but it's just not seeming to trigger for me

        const drvr = window.driver.js.driver(script);
        drvr.onPopoverRender = function (popover) {
            console.log('Popover Rendered');
        }
        drvr.drive();
    }
troniousVMgr commented 3 months ago

I also tried the following with no success:

        const drvr = window.driver.js.driver({
            steps: script.steps,
            onPopoverRender: function (popover) {
                console.log('Popover Rendered');
            }
        }); 
troniousVMgr commented 3 months ago

FOUND THE ANSWER:

Documentation seems to indicate "onPopoverRender" -> https://driverjs.com/docs/theming

I searched the code and found onPopoverRender(ed) and it's now firing

No big deal...thanks for a great library. This has really saved me a lot of manual labor getting an onboarding utility built for our system.

Dio94 commented 3 months ago

Hello,

Just adding our search results:

The actual website documentation suggests to install the 1.0.1 version to work with, while the onPopover documentation seems based on the latest (1.3.1).

Comparing both versions shows a difference between the onPopovered property on 1.0.1 and onPopover property on 1.3.1 (observing https://cdnjs.cloudflare.com/ajax/libs/driver.js/1.0.1/driver.js.iife.js and https://cdnjs.cloudflare.com/ajax/libs/driver.js/1.3.1/driver.js.iife.js).

It was our source of confusion using the library and not triggering the event :)

@kamranahmedse the website may need an update?

Regards.