Skip to content

Commit

Permalink
pkp/pkp-lib#9996 Remove error for input that gets hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
jardakotesovec committed Jun 6, 2024
1 parent 80b6f64 commit f02b0f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/Form/Form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ export default {
FormLocales,
FormPage,
},
provide() {
return {removeError: this.removeError};
},
props: {
/** Used by a parent component, such as `Container`, to identify events emitted from the form and update the form props when necessary. */
id: String,
Expand Down
4 changes: 4 additions & 0 deletions src/components/Form/fields/FieldBase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default {
Tooltip,
MultilingualProgress,
},
inject: ['removeError'],
props: {
/** The key for this field. Used in the `name` attribute of `<input>`, `<textarea>`, `<select>` and other fields. The form will submit the value for this field under this name, so it must match an accepted value of the API endpoint. */
name: String,
Expand Down Expand Up @@ -255,6 +256,9 @@ export default {
});
},
},
beforeUnmount() {
this.removeError(this.name, this.localeKey);
},
methods: {
/**
* Helper function to compile unique IDs for labels and aria-describedby
Expand Down

0 comments on commit f02b0f4

Please sign in to comment.