From 44a3fcd7d5808d61caa8af5432487841cb8490b1 Mon Sep 17 00:00:00 2001 From: Solomon Kahsai Date: Tue, 23 Dec 2025 11:33:43 +0100 Subject: [PATCH] Fix: Load dropdown items dynamically and mark current selection Dynamic Loading: - Uses actual vocabulary size from pageInfo.totalElements - Caps at 200 items to prevent loading huge vocabularies - Performance scaled: 50 items (Good UX), 100 items (Acceptable), 200 items (Borderline) Selection Highlighting: - Highlight current value when menu opens (setSelectedIndexToCurrentValue) - Treat 'Clear selection' as index 0, adjust item indices (i+1) - Arrow key navigation respects clear item (totalItems) - Enter selects correct item or clears when index = 0 - Skip disabled items in scrollToSelected - Selected items now highlighted correctly up to position 200# This is the 1st commit message: --- ...dynamic-scrollable-dropdown.component.html | 3 +- .../dynamic-scrollable-dropdown.component.ts | 58 ++++++++++++++++--- 2 files changed, 52 insertions(+), 9 deletions(-) diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.html b/src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.html index b60c93bb87f..e55420aa9f4 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.html +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.html @@ -49,6 +49,7 @@ } @for (listEntry of optionsList; track listEntry; let i = $index) {