fix: only phrasing content is allowed inside label element

This commit is contained in:
Christian Andolf
2024-10-29 13:35:13 +01:00
parent cfc400a619
commit a37cd3ff44
4 changed files with 35 additions and 24 deletions

View File

@@ -128,10 +128,12 @@ export default function Search({ locations }: SearchProps) {
}) => (
<div className={styles.container}>
<label {...getLabelProps({ htmlFor: name })} className={styles.label}>
<Caption color={isOpen ? "uiTextActive" : "red"}>
{state.searchData?.type === "hotels"
? state.searchData?.relationships?.city?.name
: intl.formatMessage({ id: "Where to" })}
<Caption color={isOpen ? "uiTextActive" : "red"} asChild>
<span>
{state.searchData?.type === "hotels"
? state.searchData?.relationships?.city?.name
: intl.formatMessage({ id: "Where to" })}
</span>
</Caption>
</label>
<div {...getRootProps({}, { suppressRefError: true })}>