23critters/StyleSelect — Issue #1: A few remarks (regarding events mainly)
Author: Rolf-nl
Created: 2011-12-19 20:43:46+00:00
State: open

Nice class, have been looking for something like this that has some extended features which I think this one has or can offer in the future. Also nice to see a Simple/Multiple version.

However, I think there are some flaws - but correct me if I'm wrong please.
- When you click on the div to open the select options you add the keydown event. When you click on an option you don't remove the event which is strange because the option list closes and you think events are removed. Try pressing cmd-r or ctrl-r to reload the browser window and it won't work.
- Can't the keydown events be added to the list container instead of the document? Or at least it should work correctly (meaning removeEvents on the document should be 100%)
- Why don't you use fireEvent when you select something, (focusing on Simple mode now), you manually have to use getSelected which is strange when you want instant feedback from the class to do other stuff after selecting something for example.
- I think setting fixed dimensions automatically that can not be overwritten by css (without using !important) is not user friendly. I mean setting width, height, padding and margin in _setup.

Ok, I could have forked it and made some code adjustments about the stuff I mention. But I didn't have time for it yet. What I have done at the moment is copy the source and made some rough adjustments for some project I'm working on with the intentions to put it on github. Not sure if I will send a pull request, because it's probably not a code fix, more a variation of what you have now.. but anyway - I like it. :)