Changeset 5657
- Timestamp:
- 05/22/08 09:32:47 (3 months ago)
- Location:
- trunk/plugins/autocomplete
- Files:
-
- 4 modified
-
changelog.txt (modified) (1 diff)
-
demo/index.html (modified) (1 diff)
-
jquery.autocomplete.js (modified) (3 diffs)
-
todo (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/autocomplete/changelog.txt
r5633 r5657 4 4 * Fixed ac_even class (was ac_event) 5 5 * Fixed bgiframe usage: now its really optional 6 * Removed the blur-on-return workaround, added a less obtrusive one only for Opera 6 7 7 8 1.0 -
trunk/plugins/autocomplete/demo/index.html
r5475 r5657 241 241 </select> 242 242 </p> 243 244 <input type="submit" value="Submit" /> 243 245 </form> 244 246 -
trunk/plugins/autocomplete/jquery.autocomplete.js
r5633 r5657 79 79 var select = $.Autocompleter.Select(options, input, selectCurrent, config); 80 80 81 var blockSubmit; 82 83 // prevent form submit in opera when selecting with return key 84 $.browser.opera && $(input.form).bind("submit.autocomplete", function() { 85 if (blockSubmit) { 86 blockSubmit = false; 87 return false; 88 } 89 }); 90 81 91 $input.keydown(function(event) { 82 92 // track last key pressed … … 124 134 case KEY.TAB: 125 135 case KEY.RETURN: 126 if( selectCurrent() ){ 127 // make sure to blur off the current field 128 if( !options.multiple ) 129 $input.blur(); 130 event.preventDefault(); 136 if( selectCurrent() ) { 137 // stop default to prevent a form submit, Opera needs special handling 138 if (!$.browser.opera) 139 event.preventDefault(); 140 else 141 blockSubmit = true; 131 142 } 132 143 break; … … 186 197 select.unbind(); 187 198 $input.unbind(); 199 $(input.form).unbind(".autocomplete"); 188 200 }); 189 201 -
trunk/plugins/autocomplete/todo
r5336 r5657 1 - multiple + mustMatch: incorrect value deletes more then just the incorrect value -> delete only the last value 2 - multiple without mustMatch: incorrect value + seperator inserts last match -> don't 3 1 4 2 5 TODO
