Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create select from element, array of elements #42

Open
TivoSoho opened this issue Mar 12, 2024 · 0 comments
Open

Cannot create select from element, array of elements #42

TivoSoho opened this issue Mar 12, 2024 · 0 comments

Comments

@TivoSoho
Copy link

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');
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

No branches or pull requests

1 participant