Skip to content

Cannot create select from element, array of elements #42

@ghost

Description

Currently it only accepts querySelectorAll for getting the base objects. However we read configuration PER element and instantiate it accordingly (some have search, some not etc). It should accept: NodeList and HTMLElement.

Should be solved with something like this:

let originalSelects = [];
if(selector instanceof NodeList) originalSelects = selector;
elseif(selector instanceof HTMLElement) originalSelects = [selector];
elseif(typeof selector === 'string' || selector instanceof String)originalSelects = document.querySelectorAll(selector);
else throw new Error('Parameter for select must be... blabla');

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