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

Multiple instances can be open at the same time #63

Closed
skeptic35 opened this issue Dec 20, 2017 · 0 comments
Closed

Multiple instances can be open at the same time #63

skeptic35 opened this issue Dec 20, 2017 · 0 comments

Comments

@skeptic35
Copy link

I noticed that when I have multiple instances of selectr on my page, I can have all of them open at the same time.
From what I gather this - imho unintended - behaviour is caused by these lines of code:

		// Non-native dropdown
		this.selected.addEventListener("click", function(e) {

			if (!that.disabled) {
				that.toggle();
			}

			e.stopPropagation();
			e.preventDefault();
		});

The call to e.stopPropagation() prevents other instances (or in fact any other element on the page) from reacting to the click event.
As far as I could see there is not really a reason for the stopPropagation, at least removing it did not lead to any strange behaviour in my app.

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

1 participant