implement review comments

This commit is contained in:
Maurits Lourens 2021-08-17 19:57:11 +02:00
parent 6aaf73788d
commit eb383f68bc
1 changed files with 22 additions and 2 deletions

View File

@ -41,6 +41,7 @@
if (readonly) { if (readonly) {
return return
} }
searchTerm = null
open = true open = true
} }
@ -59,7 +60,7 @@
if (autocomplete && term) { if (autocomplete && term) {
const lowerCaseTerm = term.toLowerCase() const lowerCaseTerm = term.toLowerCase()
return options.filter(option => return options.filter(option =>
getLabel(option).toLowerCase().includes(lowerCaseTerm) getLabel(option)?.toLowerCase().includes(lowerCaseTerm)
) )
} }
return options return options
@ -116,8 +117,8 @@
> >
{#if autocomplete} {#if autocomplete}
<Search <Search
value={searchTerm}
on:change={event => (searchTerm = event.detail)} on:change={event => (searchTerm = event.detail)}
updateOnChange="true"
{disabled} {disabled}
placeholder="Search" placeholder="Search"
/> />
@ -214,4 +215,23 @@
padding-top: 5px; padding-top: 5px;
padding-right: 10px; padding-right: 10px;
} }
.spectrum-Popover :global(.spectrum-Search) {
margin-top: -1px;
margin-left: -1px;
width: calc(100% + 2px);
}
.spectrum-Popover :global(.spectrum-Search input) {
height: auto;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
padding-top: var(--spectrum-global-dimension-size-100);
padding-bottom: var(--spectrum-global-dimension-size-100);
}
.spectrum-Popover :global(.spectrum-Search .spectrum-ClearButton) {
right: 1px;
top: 2px;
}
.spectrum-Popover :global(.spectrum-Search .spectrum-Textfield-icon) {
top: 9px;
}
</style> </style>