make sure to get proper tag value + use selected tag if possible
This commit is contained in:
		
							parent
							
								
									ce10831137
								
							
						
					
					
						commit
						03240220d4
					
				| @ -47,10 +47,9 @@ $(function(){ | |||||||
| 		} else if (keyCode == 9) { | 		} else if (keyCode == 9) { | ||||||
| 			e.preventDefault(); | 			e.preventDefault(); | ||||||
| 
 | 
 | ||||||
| 			var tag = $('.tagit-autocomplete[style*=\"display: block\"] > li:first').text(); | 			var tag = $('.tagit-autocomplete[style*=\"display: block\"] > li:focus, .tagit-autocomplete[style*=\"display: block\"] > li:first').first(); | ||||||
| 			if(tag){ | 			if(tag.length){ | ||||||
| 				$('[name=search]').tagit('createTag', tag); | 				$(tag).click(); | ||||||
| 				$('.ui-autocomplete-input').autocomplete('close'); |  | ||||||
| 				$('.ui-autocomplete-input').val(''); //If tag already exists, make sure to remove duplicate.
 | 				$('.ui-autocomplete-input').val(''); //If tag already exists, make sure to remove duplicate.
 | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user