Hi,
I’ve got the following select box:
[All Sizes]
20’
40’
40’ RF
LCL
By default, the [All Sizes] is displayed.
However, whenever I click in the combo box, the field automatically changes to LCL. After some debugging, I realized that the problem lies in the filterSelf() method.
try{ var filter=new RegExp("^"+text,"i"); } catch (e){ var filter=new RegExp("^"+text.replace(/([\[\]\{\}\(\)\+\*\\])/g,"\\$1")); }
Given that text is [All Users], filter then becomes “/^[All Users]/i”. Which means that the only option that matches is “LCL” (ie: starts with ‘L’).
The fix is fairly evident. Modify the line to read:
var filter=new RegExp("^"+text.replace(/([\[\]\{\}\(\)\+\*\\])/g,"\\$1"));
The question is if there is a reason why this isn’t done directly in the first place, rather than only in the catch block?
Thanks,
Eric