From 5c7cf125512627332f2fa7447244e1f2639c867d Mon Sep 17 00:00:00 2001 From: rdrew Date: Wed, 15 Apr 2026 15:45:46 -0300 Subject: [PATCH] search display --- js/custom.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/js/custom.js b/js/custom.js index 08689e5..d6dd53f 100644 --- a/js/custom.js +++ b/js/custom.js @@ -3,8 +3,18 @@ attach: function (context) { function processField(id) { var el = document.getElementById(id); - if (!el || el.value === "") return; - el.value = parseInt(el.value, 10); + if (!el) return; + + // If value isn't populated yet, wait and retry once + if (el.value === "") { + setTimeout(function () { + processField(id); + }, 100); + return; + } + + var str = el.value.toString().slice(0, -3); + el.value = parseInt(str, 10); } once("from-slider", "#nouislider-input-from", context).forEach(