fix: input onchange event

This commit is contained in:
DIYgod 2022-08-17 16:38:55 +01:00
parent e09baf9b6c
commit c570c6a617
No known key found for this signature in database
GPG Key ID: D159328F47A80DCA
2 changed files with 3 additions and 7 deletions

View File

@ -10,7 +10,6 @@ type InputProps<TMultiline extends boolean> = {
error?: string
help?: React.ReactNode
multiline?: TMultiline
onChangeText?: (value: string) => void
} & React.ComponentPropsWithRef<TMultiline extends true ? "textarea" : "input">
export const Input = forwardRef(function Input<
@ -25,7 +24,6 @@ export const Input = forwardRef(function Input<
error,
help,
multiline,
onChangeText,
...inputProps
}: InputProps<TMutliline>,
ref: TMutliline extends true
@ -55,7 +53,6 @@ export const Input = forwardRef(function Input<
isBlock && `is-block`,
className,
)}
onChange={onChangeText}
/>
{addon && (
<span className="flex items-center px-3 text-gray-600 bg-gray-50 h-10 border border-l-0 rounded-r-lg relative -z-10">

View File

@ -36,9 +36,9 @@ export default function SettingsDomainsPage() {
}
const [customDomain, setCustomDomain] = useState("")
const customDomainChange = (e: any) => {
setCustomDomain(e.target.value)
}
form.register("custom_domain", {
onChange: (e) => setCustomDomain(e.target.value),
})
useEffect(() => {
if (updateSite.isSuccess) {
@ -84,7 +84,6 @@ export default function SettingsDomainsPage() {
id="custom_domain"
label="Custom Domain"
className="w-64"
onChangeText={customDomainChange}
{...form.register("custom_domain")}
/>
{customDomain && (