Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SSHOC
sshoc-marketplace-frontend
Commits
27e36761
Commit
27e36761
authored
Mar 10, 2021
by
Stefan Probst
Browse files
fix: make form controls controlled components
parent
2d60ac94
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/modules/form/components/FormAutoSuggest/FormAutoSuggest.tsx
View file @
27e36761
...
...
@@ -37,7 +37,7 @@ export function FormAutoSuggest<T>(
onBlur
:
input
.
onBlur
,
onFocus
:
input
.
onFocus
,
onInputChange
:
input
.
onChange
,
defaultI
nputValue
:
meta
.
initial
,
i
nputValue
:
input
.
value
,
})
}
{
...
getFormFieldValidationState
(
meta
)
}
/>
...
...
src/modules/form/components/FormCheckBox/FormCheckBox.tsx
View file @
27e36761
...
...
@@ -22,7 +22,7 @@ export function FormCheckBox(props: FormCheckBoxProps): JSX.Element {
onBlur
:
input
.
onBlur
,
onFocus
:
input
.
onFocus
,
onChange
:
input
.
onChange
,
default
Selected
:
meta
.
initial
,
is
Selected
:
input
.
checked
,
})
}
{
...
getFormFieldValidationState
(
meta
)
}
/>
...
...
src/modules/form/components/FormCheckBoxGroup/FormCheckBoxGroup.tsx
View file @
27e36761
...
...
@@ -22,7 +22,7 @@ export function FormCheckBoxGroup(props: FormCheckBoxGroupProps): JSX.Element {
onBlur
:
input
.
onBlur
,
onFocus
:
input
.
onFocus
,
onChange
:
input
.
onChange
,
defaultValue
:
meta
.
initial
,
value
:
input
.
value
,
})
}
{
...
getFormFieldValidationState
(
meta
)
}
/>
...
...
src/modules/form/components/FormComboBox/FormComboBox.tsx
View file @
27e36761
...
...
@@ -28,7 +28,7 @@ export function FormComboBox<T>(props: FormComboBoxProps<T>): JSX.Element {
onBlur
:
input
.
onBlur
,
onFocus
:
input
.
onFocus
,
onSelectionChange
:
input
.
onChange
,
defaultS
electedKey
:
meta
.
initial
,
s
electedKey
:
input
.
value
,
})
}
{
...
getFormFieldValidationState
(
meta
)
}
/>
...
...
src/modules/form/components/FormSelect/FormSelect.tsx
View file @
27e36761
...
...
@@ -25,7 +25,7 @@ export function FormSelect<T>(props: FormSelectProps<T>): JSX.Element {
onBlur
:
input
.
onBlur
,
onFocus
:
input
.
onFocus
,
onSelectionChange
:
input
.
onChange
,
defaultS
electedKey
:
meta
.
initial
,
s
electedKey
:
input
.
value
,
})
}
{
...
getFormFieldValidationState
(
meta
)
}
/>
...
...
src/modules/form/components/FormTextArea/FormTextArea.tsx
View file @
27e36761
...
...
@@ -22,7 +22,7 @@ export function FormTextArea(props: FormTextAreaProps): JSX.Element {
onBlur
:
input
.
onBlur
,
onFocus
:
input
.
onFocus
,
onChange
:
input
.
onChange
,
defaultValue
:
meta
.
initial
,
value
:
input
.
value
,
})
}
{
...
getFormFieldValidationState
(
meta
)
}
/>
...
...
src/modules/form/components/FormTextField/FormTextField.tsx
View file @
27e36761
...
...
@@ -24,7 +24,7 @@ export function FormTextField(props: FormTextFieldProps): JSX.Element {
onBlur
:
input
.
onBlur
,
onFocus
:
input
.
onFocus
,
onChange
:
input
.
onChange
,
defaultValue
:
meta
.
initial
,
value
:
input
.
value
,
})
}
{
...
getFormFieldValidationState
(
meta
)
}
/>
...
...
src/screens/contact/ContactScreen.tsx
View file @
27e36761
...
...
@@ -83,13 +83,6 @@ function ContactForm() {
const
subject
=
useQueryParam
(
'
subject
'
,
false
)
const
message
=
useQueryParam
(
'
message
'
,
false
)
useEffect
(()
=>
{
// remove query params from url
if
(
router
.
isReady
&&
Object
.
keys
(
router
.
query
).
length
>
0
)
{
router
.
replace
({
query
:
{}
},
undefined
,
{
shallow
:
true
})
}
},
[
router
])
function
onSubmit
(
formData
:
ContactFormData
)
{
// const recaptchaValue = recaptchaRef.current?.getValue()
// recaptchaRef.current?.reset()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment