Skip to content

Commit

Permalink
fix(GovAlta#1957): date picker year selection not appearing
Browse files Browse the repository at this point in the history
  • Loading branch information
syedszeeshan committed Jun 26, 2024
1 parent b23d6f9 commit 725d6a1
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions libs/web-components/src/components/dropdown/Dropdown.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
}
function setSelected() {
_selectedOption = _options.find(o => o.value == _values[0])
_selectedOption = _options.find((o) => o.value == _values[0]);
}
// parse and convert values to strings to avoid later type comparison issues
Expand Down Expand Up @@ -212,7 +212,9 @@
function syncFilteredOptions() {
_filteredOptions = _filterable
? _options.filter((option) => isFilterMatch(option, _inputEl?.value ?? ""))
? _options.filter((option) =>
isFilterMatch(option, _inputEl?.value ?? ""),
)
: _options;
}
Expand Down Expand Up @@ -263,7 +265,7 @@
function onSelect(option: Option) {
if (_disabled) return;
if (!_native) {
hideMenu();
_selectedOption = option;
Expand Down Expand Up @@ -355,7 +357,7 @@
onEscape(e: KeyboardEvent) {
reset();
// FIXME: on escape should allow the next tab click to move to the next element, currently
// FIXME: on escape should allow the next tab click to move to the next element, currently
// clicking tab after esc will refocus onto the Dropdown
// _inputEl.focus();
Expand Down Expand Up @@ -564,7 +566,7 @@
`}
data-testid="input"
bind:this={_inputEl}
value={_selectedOption?.label ?? _selectedOption?.value ?? ""}
value={_selectedOption?.label || _selectedOption?.value || ""}
type="text"
role="combobox"
autocomplete="off"
Expand Down Expand Up @@ -638,8 +640,10 @@
<!-- svelte-ignore a11y-click-events-have-key-events -->
<li
id={option.value}
aria-selected={_selectedOption?.value === (option.label || option.value)}
class:selected={_selectedOption?.value === (option.label || option.value)}
aria-selected={_selectedOption?.value ===
(option.label || option.value)}
class:selected={_selectedOption?.value ===
(option.label || option.value)}
class="dropdown-item"
class:dropdown-item--highlighted={index === _highlightedIndex}
data-index={index}
Expand Down Expand Up @@ -688,7 +692,6 @@
}
}
.dropdown-input-group {
box-sizing: border-box;
outline: none;
Expand Down Expand Up @@ -725,7 +728,6 @@
}
}
.dropdown-icon--arrow,
.dropdown-icon--clear {
margin-right: var(--goa-space-s);
Expand Down

0 comments on commit 725d6a1

Please sign in to comment.