diff --git a/resources/views/business/pages/partials/directory-table.blade.php b/resources/views/business/pages/partials/directory-table.blade.php index 78ede8ba..0c98a7de 100644 --- a/resources/views/business/pages/partials/directory-table.blade.php +++ b/resources/views/business/pages/partials/directory-table.blade.php @@ -224,7 +224,7 @@ .directory-query-more > summary { width: fit-content; padding-top: 0.75rem; color: var(--vip-content-accent-dark, #856632); cursor: pointer; list-style: disclosure-closed; } .directory-query-more[open] > summary { list-style: disclosure-open; } .directory-query-more__fields { display: grid; grid-template-columns: repeat(4, minmax(12rem, 1fr)); gap: 1rem 1.25rem; margin-top: 1rem; } - .directory-query-suggestions { position: absolute; top: calc(100% + 0.25rem); right: 0; left: 0; z-index: 6; margin: 0; padding: 0.25rem; border: 1px solid var(--vip-border, #d8d2c7); border-radius: 0.375rem; background: #fff; box-shadow: 0 5px 12px rgba(23,23,23,0.12); list-style: none; } + .directory-query-suggestions { position: absolute; top: calc(100% + 0.25rem); right: 0; left: 0; z-index: 6; max-height: 16rem; overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 0.25rem; border: 1px solid var(--vip-border, #d8d2c7); border-radius: 0.375rem; background: #fff; box-shadow: 0 5px 12px rgba(23,23,23,0.12); list-style: none; } .directory-query-suggestions[hidden] { display: none; } .directory-query-suggestions button { display: block; width: 100%; overflow: hidden; padding: 0.4rem 0.5rem; border: 0; border-radius: 0.25rem; background: transparent; color: var(--vip-content-ink, #171717); font: inherit; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; } .directory-query-suggestions button:hover, .directory-query-suggestions button:focus { background: var(--vip-content-accent-soft, #f7f0de); outline: 0; } @@ -3733,9 +3733,10 @@ ? rows().flatMap((row) => ['legal_representative', 'shareholders', 'supervisor', 'billing_officer'] .map((column) => (row.querySelector(`[data-column-key="${column}"]`)?.textContent || '').trim())) : rows().map((row) => fieldValues(row, key)); - const values = [...new Set([...serverOptions, ...candidates].filter( + const matchedValues = [...new Set([...serverOptions, ...candidates].filter( (item) => item && item !== '—' && (!needle || String(item).toLocaleLowerCase().includes(needle)), - ))].slice(0, 8); + ))]; + const values = serverOptions.length > 0 ? matchedValues : matchedValues.slice(0, 8); list.innerHTML = values.map((item) => `
  • `).join(''); list.hidden = values.length === 0; list.querySelectorAll('button').forEach((button) => button.addEventListener('click', () => {