diff --git a/tabs/osd.js b/tabs/osd.js index 00d920821..7f11a6a60 100644 --- a/tabs/osd.js +++ b/tabs/osd.js @@ -2661,7 +2661,7 @@ OSD.GUI.updateUnits = function() { }); }; -OSD.GUI.updateFields = function() { +OSD.GUI.updateFields = function(event) { // display fields on/off and position var $tmpl = $('#osd_group_template').hide(); // Clear previous groups, if any @@ -2702,6 +2702,7 @@ OSD.GUI.updateFields = function() { }); } var $displayFields = groupContainer.find('.display-fields'); + var osdSearch = $('.osd_search'); for (var jj = 0; jj < groupItems.length; jj++) { var item = groupItems[jj]; var itemData = OSD.data.items[item.id]; @@ -2715,7 +2716,7 @@ OSD.GUI.updateFields = function() { } else { name = inflection.titleize(name); } - var searchTerm = $('.osd_search').val(); + var searchTerm = osdSearch.val(); if (searchTerm.length > 0 && !name.toLowerCase().includes(searchTerm.toLowerCase())) { continue; } @@ -2811,10 +2812,13 @@ OSD.GUI.updateFields = function() { // needs to be called after all of them have been set up GUI.switchery(); - // Update the OSD preview - refreshOSDSwitchIndicators(); - updatePilotAndCraftNames(); - updatePanServoPreview(); + if(event != null && event.currentTarget !== osdSearch[0]) + { + // Update the OSD preview + refreshOSDSwitchIndicators(); + updatePilotAndCraftNames(); + updatePanServoPreview(); + } }; OSD.GUI.removeBottomLines = function(){ @@ -3210,8 +3214,8 @@ OSD.GUI.updateAll = function() { clear.off('change'); } - $('.osd_search').on('input', function() { - OSD.GUI.updateFields(); + $('.osd_search').on('input', function(event) { + OSD.GUI.updateFields(event); }); $('.supported').fadeIn(); OSD.GUI.updateVideoMode();