gfranko / jquery.selectBoxIt.js

A jQuery Select Box Plugin for Mobile, Tablet, and Desktop
http://www.selectboxit.com
MIT License
852 stars 301 forks source link

Disabled state not prevents changes by keyboard events #350

Open evilbug opened 8 years ago

evilbug commented 8 years ago

Hello!

I've found a bug in the disabled mode of the selectbox.

If you makes the select as 'disabled' whith selectBoxIt('disabled'); then the mouse events doesn't work and you cannot change the selected value because the selecbox does not apper. But if you click on it to gain focus, and type in the keyboard you can change the options in the disabled mode.

A fix could be prevent the keyboard event while in disabled mode.

regards!

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/28513150-disabled-state-not-prevents-changes-by-keyboard-events?utm_campaign=plugin&utm_content=tracker%2F23157&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F23157&utm_medium=issues&utm_source=github).
evilbug commented 8 years ago

I've tried to make a pull request, but I'm a github newbie and it seems that I don't have permission on this repo.

The fix is to add this in line 1266: " // The keypress handler logic will only be applied if the dropdown list is enabled if (!self.originalElem.disabled) { " an a closing "}" in the 1291

evilbug commented 8 years ago

Ok i've managed to create a pull request. I didn't realize that you need to make a pull request from a forked repo :) https://github.com/gfranko/jquery.selectBoxIt.js/pull/351