Skip to content

Allow element to be type function that returns an element#463

Merged
nilbuild merged 1 commit intonilbuild:masterfrom
richie-south:element-as-function
Jan 22, 2025
Merged

Allow element to be type function that returns an element#463
nilbuild merged 1 commit intonilbuild:masterfrom
richie-south:element-as-function

Conversation

@richie-south
Copy link
Copy Markdown
Contributor

Adding option to use element as function that returns an element.
This makes it possible to have steps that selects elements that might not on be selectable right now but will be later on.

usage:

const driverObj = driver({
  animate: true,
  steps: [
    {
      element: () => document.querySelector(".page-header"),
      popover: {
        title: "",
        description:"",
      },
    }
  ]
});

driverObj.drive();

@sandstone991
Copy link
Copy Markdown

I ended up having to wrap the library code to achieve this

@nilbuild nilbuild merged commit c9713c7 into nilbuild:master Jan 22, 2025
@nilbuild
Copy link
Copy Markdown
Owner

Thank you!

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.

3 participants