Mark Lavin avatar Mark Lavin committed 4d84893

Fix JS bug with mutliple select combobox not clearing the text input. Thanks @akaihola and @lpirl. Fixes #68

Comments (0)

Files changed (2)

docs/releases.rst

 _________________
 
 - Cleaned up JS scoping problems when multiple jQuery versions are used on the page. Thanks Antti Kaihola for the report.
+- Fixed minor JS bug where text input was not cleared when selected via the combobox in the multiselect. Thanks Antti Kaihola for the report and Lukas Pirl for a hotfix.
 
 Backwards Incompatible Changes
 ________________________________

selectable/static/selectable/js/jquery.dj.selectable.js

             /* Trigger selection of a given item.
             Item should contain two properties: id and value 
             Event is the original select event if there is one.
-            Event should not be passed if trigger manually.
+            Event should not be passed if triggered manually.
             */
             var self = this,
             input = this.element;
                         });
                         $(input).after(newInput);
                         self._addDeckItem(newInput);
-                        return false;
                     }
+                    return false;
                 } else {
                     $(input).val(item.value);
                     var ui = {item: item};
                         $(input).autocomplete("search");
                         return false;
                     }
-                    self.select(ui.item, event);
+                    return self.select(ui.item, event);
                 }
             }).addClass("ui-widget ui-widget-content ui-corner-all");
             // Override the default auto-complete render.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.