If search option is set in template, don't override it with automatic chosen switch based on option count.

This commit is contained in:
Nathan Gray 2013-11-27 18:07:36 +00:00
parent fa65814f9e
commit aed7267801

View File

@ -174,8 +174,8 @@ class etemplate_widget_menupopup extends etemplate_widget
{
self::fix_encoded_options(self::$request->sel_options[$options]);
// Turn on search, if there's a lot of rows
if(count(self::$request->sel_options[$options]) >= self::SEARCH_ROW_LIMIT)
// Turn on search, if there's a lot of rows (unless explicitly set)
if(!array_key_exists('search',$this->attrs) && count(self::$request->sel_options[$options]) >= self::SEARCH_ROW_LIMIT)
{
self::setElementAttribute($form_name, "search", true);
}