GuavaCZ / tutorials

MIT License
38 stars 7 forks source link

Uncaught (in promise) DOMException: Failed to execute 'querySelector' on 'Document' #5

Closed invaders-xx closed 2 months ago

invaders-xx commented 7 months ago

I created a tutorial using latest version :

public function tutorial(Tutorial $tutorial): Tutorial
    {
        return $tutorial->steps([
            Step::make('.page-layout-action')
                ->label(__('Page layout')),
        ]);
    }

and I have an action button on the page with class 'page-layout-action' and I get this console error :

step.js:209 Uncaught (in promise) DOMException: Failed to execute 'querySelector' on 'Document': '#data..page-layout-action' is not a valid selector.

Did I miss smth ?

fsamapoor commented 2 months ago

Hey @invaders-xx,

I was able to select the HTML elements using the Selector::make() selector.

Lukas has given an example himself, but it seems like this is undocumented in the readme file.

Like this:

Step::make(Selector::make('.fi-sidebar-item:has(a[href*="scores"])'))
lukas-frey commented 2 months ago

Hi, thanks a lot for noticing the issue in the documentation.