brianreavis/selectize.js — pull request #185 by JedWatson (2013-11-05 04:55:03+00:00)
Title: Adding support for focus and blur events

Hi,

First of all, thanks for your great work on this!

I added support for focus and blur events on the control. It watches the previous state of the .isFocused boolean to ensure the event is only fired when the focus state changes, rather than when the internal focus event is called.

I've got a use case where I want to clear the value on focus, then reset it on blur unless it has been changed, which makes selectize work more like the URL bar in a browser.

But I expect it will be useful for other cases as well, including more sophisticated interaction with other UI controls, etc.

Cheers,
Jed.