Cleanup Dropdown UI
This commit is contained in:
1 parent
cd595cb062
commit
167dd7bb99
6 files changed
+103
-61
No files matched your search
@@ -2,19 +2,19 @@
|
||||
@if (icon()) {
|
||||
<span class="material-symbols-outlined icon-24 prefix-icon">{{ icon() }}</span>
|
||||
}
|
||||
<span class="placeholder">{{ selectedLabel }}</span>
|
||||
<span class="placeholder">{{ selectedLabel() }}</span>
|
||||
<span class="material-symbols-outlined icon-24 chevron" [class.open]="isOpen()">keyboard_arrow_down</span>
|
||||
</div>
|
||||
|
||||
@if (isOpen()) {
|
||||
<ul class="dropdown-list" role="listbox">
|
||||
@for (option of options(); track option.value; let i = $index) {
|
||||
@for (option of normalizedOptions(); track option.value; let i = $index) {
|
||||
<li
|
||||
class="dropdown-item"
|
||||
role="option"
|
||||
[class.selected]="option.value === selectedValue()"
|
||||
[class.selected]="option.value === value()"
|
||||
[class.focused]="i === focusedIndex()"
|
||||
[attr.aria-selected]="option.value === selectedValue()"
|
||||
[attr.aria-selected]="option.value === value()"
|
||||
(click)="selectOption(option); $event.stopPropagation()">
|
||||
{{ option.label }}
|
||||
</li>
|
||||
|
||||
Reference in new issue
Block a user