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

multibox is not showing selected entries initial #9

Open
ChristianSchmidt1981 opened this issue Jun 2, 2021 · 2 comments
Open

multibox is not showing selected entries initial #9

ChristianSchmidt1981 opened this issue Jun 2, 2021 · 2 comments

Comments

@ChristianSchmidt1981
Copy link

I've a select box with some selected entries in the html-code.

than i am init the multi-box with

` const multiSelect = new IconicMultiSelect({
select: selectorString,
customCss: true
});

    multiSelect.init();`

but the initial selected option-tags in the selectbox are not visible.

I could add it with

$(selectorString + " option[selected='selected']").each(function() { const value = this.value; const target = Array.from(multiSelect.domElements.options).find(function (el) { return el.dataset.value === value; }); multiSelect._handleOption( target, false); })

for making initial entries are visible.

@ChristianSchmidt1981 ChristianSchmidt1981 changed the title multishow is not showing selected entries initial multibox is not showing selected entries initial Jun 2, 2021
@thinkmobilede
Copy link

unfortunately the workaround by @ChristianSchmidt1981 does not work anymore in the current version as the accessors are private now. I had to modify them to make them public. Why are they private if the Library does not initialize itself?

@sidneywm
Copy link
Owner

sidneywm commented Oct 2, 2021

I've added this feature in the new version. Option tags with the selected attribute are automatically initialized at runtime.

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

3 participants