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

fix: make textfield a controlled component #830

Merged
merged 5 commits into from
Dec 13, 2022

Conversation

scottyoung
Copy link
Contributor

Issue #, if available:
Moving TextField from uncontrolled to controlled allows resetStateValues to properly reset its field to its initial state. This is called both during Clear onClick as well as during a success Submit if clearOnSubmit is set to true. This also contributes to the overall task of moving all components to controlled.

Tested locally in app with Date and Time fields, as well as interacting with onSubmit and reset onClick calls.

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@scottyoung scottyoung requested a review from a team as a code owner December 12, 2022 16:41
@codecov-commenter
Copy link

codecov-commenter commented Dec 12, 2022

Codecov Report

Merging #830 (e19a458) into main (6898d10) will increase coverage by 0.06%.
The diff coverage is 95.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #830      +/-   ##
==========================================
+ Coverage   91.63%   91.69%   +0.06%     
==========================================
  Files         102      102              
  Lines        4122     4128       +6     
  Branches     1175     1174       -1     
==========================================
+ Hits         3777     3785       +8     
+ Misses        325      324       -1     
+ Partials       20       19       -1     
Impacted Files Coverage Δ
packages/codegen-ui-react/lib/forms/form-state.ts 98.49% <ø> (ø)
.../codegen-ui-react/lib/forms/react-form-renderer.ts 84.07% <50.00%> (+1.25%) ⬆️
...ges/codegen-ui-react/lib/forms/component-helper.ts 96.00% <100.00%> (-1.37%) ⬇️
...codegen-ui-react/lib/forms/form-renderer-helper.ts 98.32% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6898d10...e19a458. Read the comment docs.

@scottyoung scottyoung merged commit 1dcda83 into main Dec 13, 2022
@scottyoung scottyoung deleted the make-textfield-controlled branch December 13, 2022 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants