Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Input cannot be found if javascript is run before element is present #38

Closed
@gingermusketeer

Description

@gingermusketeer

I had some issues getting started with this module as the input could not be found when the element is connected.

Debugging I found it was due to

if (!(input instanceof HTMLInputElement) || !results) return

It was then I realised that the javascript needs to be run after the element is on the page. I was able to verify this by changing the example provided such that the javascript tag was in the head of the page.

Should there be a console log or should this case be handled?

I suspect that this might mean this element cannot be added to the page dynamically if the javascript is already present.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions