From c32cdaa4dfe6fe65b42d36ad4ac8ef63116e3d71 Mon Sep 17 00:00:00 2001 From: Matthew-X Date: Sat, 27 Dec 2025 02:40:07 +1300 Subject: [PATCH] Fixed issue with regional prompt state save. --- javascript/state.ext.mask-regional-prompter.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/javascript/state.ext.mask-regional-prompter.js b/javascript/state.ext.mask-regional-prompter.js index f2eca34..ae94fb9 100644 --- a/javascript/state.ext.mask-regional-prompter.js +++ b/javascript/state.ext.mask-regional-prompter.js @@ -80,8 +80,11 @@ state.extensions['mask-regional-prompter'] = (function () { setInterval(() => { const currentValue = el.value; const storedValue = store.get(key); - if (currentValue && currentValue !== storedValue && currentValue.length > 10) { - store.set(key, currentValue); + // Save if: value has changed AND (it's non-trivial OR we're clearing a non-empty stored value) + if (currentValue !== storedValue) { + if (currentValue.length > 10 || (currentValue === '' && storedValue && storedValue.length > 0)) { + store.set(key, currentValue); + } } }, 2000); }