Skip to content

2 bugfixes #5

@beholder4096

Description

@beholder4096

Hi, I love your little datalist select. THANKS!! Here are two bugfixes that I have figured out for some anomalous behavior:

after the 1st "opt && opt.focus();" add:
// bugfix: stopping event propagation prevents list immediately moving, just focuses on first option
e.preventDefault();

after the 2nd "opt && opt.focus();" add:
// bugfix: focused element position would jump in relation to view when it is at the bottom of the view
opt && opt.scrollIntoView({behavior: "instant", block: "center",});


Also you could mention in readme that people should run their browser with parameter --allow-file-access-from-files (Chrome/Chromium/Vivaldi/Edge) since external scripts are normally disabled when viewing your demo in browser with file:// protocol. For example recommend running Edge as:
"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --allow-file-access-from-files

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions