fix(sw-350): fixed ui-comments for calendar, search and widget

This commit is contained in:
Pontus Dreij
2024-10-14 12:04:05 +02:00
parent 89d65cec38
commit b3b26be83c
16 changed files with 80 additions and 47 deletions

View File

@@ -48,15 +48,6 @@ export default function Search({ locations }: SearchProps) {
dispatch({ type: ActionType.CLEAR_HISTORY_LOCATIONS })
}
function handleOnBlur() {
if (!value && state.searchData?.name) {
setValue(name, state.searchData.name)
// Always need to manually trigger
// revalidation when setting value r-h-f
trigger()
}
}
function handleOnChange(
evt: FormEvent<HTMLInputElement> | ChangeEvent<HTMLInputElement>
) {
@@ -67,6 +58,7 @@ export default function Search({ locations }: SearchProps) {
type: ActionType.SEARCH_LOCATIONS,
})
} else {
console.log("clear")
dispatch({ type: ActionType.CLEAR_SEARCH_LOCATIONS })
}
}
@@ -156,7 +148,6 @@ export default function Search({ locations }: SearchProps) {
}),
...register(name, {
onBlur: function () {
handleOnBlur()
closeMenu()
},
onChange: handleOnChange,

View File

@@ -24,8 +24,3 @@
p {
color: var(--UI-Text-Active);
}
.container:hover:has(input:not(:active, :focus, :focus-within))
input::-webkit-search-cancel-button {
display: none;
}