mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
Fixed glitch when setting autocomplete field to emtpy
This commit is contained in:
@@ -8,6 +8,7 @@ $(document).ready(function() {
|
|||||||
$(this).autocomplete({
|
$(this).autocomplete({
|
||||||
source: source,
|
source: source,
|
||||||
minLength: 3,
|
minLength: 3,
|
||||||
|
delay: 500,
|
||||||
focus: function(e, ui) {
|
focus: function(e, ui) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
$(this).val(ui.item.label);
|
$(this).val(ui.item.label);
|
||||||
@@ -17,7 +18,12 @@ $(document).ready(function() {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
$(this).val(ui.item.label);
|
$(this).val(ui.item.label);
|
||||||
$("#"+$(this).data('target')).val(ui.item.value)
|
$("#"+$(this).data('target')).val(ui.item.value)
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
$(this).on('blur', function () {
|
||||||
|
if ($(this).val() == "") {
|
||||||
|
$("#" + $(this).data('target')).val('');
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
Reference in New Issue
Block a user