Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add onchange to props for field input and bool #261

Merged
merged 1 commit into from
Apr 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/npm-fastui/src/components/FormField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface FormFieldInputProps extends FormFieldInput {
}

export const FormFieldInputComp: FC<FormFieldInputProps> = (props) => {
const { name, placeholder, required, htmlType, locked, autocomplete } = props
const { name, placeholder, required, htmlType, locked, autocomplete, onChange } = props

return (
<div className={useClassName(props)}>
Expand All @@ -40,6 +40,7 @@ export const FormFieldInputComp: FC<FormFieldInputProps> = (props) => {
placeholder={placeholder}
autoComplete={autocomplete}
aria-describedby={descId(props)}
onChange={onChange}
/>
<ErrorDescription {...props} />
</div>
Expand Down Expand Up @@ -78,7 +79,7 @@ interface FormFieldBooleanProps extends FormFieldBoolean {
}

export const FormFieldBooleanComp: FC<FormFieldBooleanProps> = (props) => {
const { name, required, locked } = props
const { name, required, locked, onChange } = props

return (
<div className={useClassName(props)}>
Expand All @@ -92,6 +93,7 @@ export const FormFieldBooleanComp: FC<FormFieldBooleanProps> = (props) => {
required={required}
disabled={locked}
aria-describedby={descId(props)}
onChange={onChange}
/>
<ErrorDescription {...props} />
</div>
Expand Down