Skip to content
New issue

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

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

Already on GitHub? # to your account

fix: FormValidationElement compares values #744

Merged
merged 2 commits into from
Mar 12, 2022
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

### 3.5.1 (2022-03-11)

- [744](https://github.com/influxdata/clockface/pull/744): FormValidationElement bug fix

### 3.5.0 (2022-03-10)

- [738](https://github.com/influxdata/clockface/pull/740): Added input functionality to the PaginationNav
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@influxdata/clockface",
"version": "3.5.0",
"version": "3.5.1",
"license": "MIT",
"main": "dist/index.js",
"style": "dist/index.css",
Expand Down
5 changes: 4 additions & 1 deletion src/Components/Form/FormValidationElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,15 @@ export const FormValidationElement = forwardRef<
ref
) => {
const shouldPerformValidation = useRef<boolean>(prevalidate)
const originalValue = useRef(value)

let errorMessage = null
let status = ComponentStatus.Default

useEffect(() => {
shouldPerformValidation.current = true
if (originalValue.current !== value) {
shouldPerformValidation.current = true
}
}, [value])

if (shouldPerformValidation.current) {
Expand Down