Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

Selectr is not idempotent #145

Open
rnickmccandless opened this issue May 27, 2020 · 1 comment
Open

Selectr is not idempotent #145

rnickmccandless opened this issue May 27, 2020 · 1 comment

Comments

@rnickmccandless
Copy link

When instantiating an instance of new Selectr(element) with the same element multiple times, Selectr generates new HTML markup resulting in duplicating drop downs.

Unexpected result:
Screen Shot 2020-05-27 at 1 09 16 AMe

This was first noticed when using Turbolinks while navigating the website forward, then back.

* I understand that at this time, the project is not being maintained. Hopefully this project will see a new maintainer soon since Selectr has been a great simple way to apply a better select element.

@Xaraxia
Copy link

Xaraxia commented Sep 21, 2020

I've worked around this problem by detecting the classes on the underlying element, and not making the Selectr call if it doesn't exist. Suboptimal, yes, but it works.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants