Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Ignore clicks on disabled menu items #1181

Merged

Conversation

jwarby
Copy link

@jwarby jwarby commented Mar 19, 2015

The Select component shouldn't allow a menu option with the 'disabled' class to be selected (see Disabled menu options).

It is easy enough to bind a click handler to Select component's DOM element to prevent this behaviour, but there is no way to achieve this for dynamically inserted Select components. Many MVC frameworks use event delegation to handle events for dynamically inserted DOM content, so there is no way to prevent this behaviour in such frameworks (at least not without breaking the framework's conventions by hacking in a workaround).

This jsfiddle might help to explain the issue a bit more clearly.

li.disabled class); add tests to ensure Select value doesn't change and changed
event doesn't fire
@interactivellama
Copy link
Contributor

Thanks, @jwarby. Will review.

@jwarby
Copy link
Author

jwarby commented Apr 3, 2015

I just noticed this is targeted to the 3.6.5 milestone, but my pull request is for FuelUX 2 (as is my other outstanding pull request) - just thought I should mention...

@swilliamset swilliamset modified the milestones: 2.6.6, 3.6.5 Apr 3, 2015
@interactivellama
Copy link
Contributor

Sorry, thanks for the clarification.

interactivellama added a commit that referenced this pull request Apr 11, 2015
@interactivellama interactivellama merged commit 6b4343b into ExactTarget:fuelux2 Apr 11, 2015
@jwarby jwarby deleted the issue-disabled-select-items branch April 15, 2015 15:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants