From 4ff397e9c12dc650b28fea4727d366306f1a0cfd Mon Sep 17 00:00:00 2001 From: Will Miao Date: Mon, 19 Jan 2026 09:17:05 +0800 Subject: [PATCH] fix(modals): preserve model type during navigation (#771) Move cleanupNavigationShortcuts() call before setting navigationModelType to ensure the correct model type is preserved when using left/right arrow keys to navigate between models. Previously, the cleanup would immediately nullify navigationModelType, causing type-specific modal sections (like trigger words for embeddings and usage tips for loras) to disappear. --- static/js/components/shared/ModelModal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/components/shared/ModelModal.js b/static/js/components/shared/ModelModal.js index 2aa84ac7..67b59276 100644 --- a/static/js/components/shared/ModelModal.js +++ b/static/js/components/shared/ModelModal.js @@ -940,8 +940,8 @@ function setupNavigationShortcuts(modelType) { const modalElement = document.getElementById('modelModal'); if (!modalElement) return; - navigationModelType = modelType; cleanupNavigationShortcuts(); + navigationModelType = modelType; navigationKeyHandler = (event) => { if (shouldIgnoreNavigationKey(event)) return;