jquery/jquery-ui — pull request #1329 by SimenB (2014-08-29 12:24:17+00:00)
Title: Selectmenu: Prevent exception when the user types in selectmenu, when teh result is an optgroup

Hi!

This is probably done somewhat wrong, but I thought I should get this in before the weekend.

If you have a Selectmenu with ``optgroup``s, and type while it has focus, it may hit an ``optgroup`` as a result. If this happens, you get an exception.

Fiddle: http://jsfiddle.net/coLcs5pz/1/

Just put focus on the selectmenu, and type ``S``, and you'll get an exception in the console.
``Uncaught TypeError: Cannot read property 'index' of undefined ``

There is probably some better way to solve this problem, but this fixes it for us at least.