Skip to content

Fixes resetting of form inputs in the BaSyx Editor#1003

Merged
aaronzi merged 1 commit intoeclipse-basyx:mainfrom
aaronzi:main
Jan 28, 2026
Merged

Fixes resetting of form inputs in the BaSyx Editor#1003
aaronzi merged 1 commit intoeclipse-basyx:mainfrom
aaronzi:main

Conversation

@aaronzi
Copy link
Member

@aaronzi aaronzi commented Jan 28, 2026

This pull request improves the initialization logic of several form components in the app by ensuring that form fields are always reset before loading data. This prevents stale data from appearing when editing or creating new items. Additionally, the assignment of form field values has been streamlined using nullish coalescing (??) to provide default values where appropriate, resulting in cleaner and more robust code.

Form state management improvements:

  • Added a resetFormValues (or clearForm) function to each form component (such as AASForm.vue, BlobForm.vue, CollectionForm.vue, EntityForm.vue, FileForm.vue, ListForm.vue, MLPForm.vue, and PropertyForm.vue) to explicitly reset all form fields to their default values before initializing input values. This ensures no stale data remains from previously opened forms. [1] [2] [3] [4] [5] [6] [7] [8]

Streamlined and safer value assignment:

  • Updated the logic for assigning values from loaded objects to form fields to use the nullish coalescing operator (??) to provide sensible defaults (e.g., null, empty string, or specific enum values) if the loaded data is missing or undefined. This makes the code more concise and robust against incomplete data. [1] [2] [3] [4] [5] [6] [7]

These changes collectively improve the user experience by ensuring form data is always current and consistent, and they also simplify and harden the codebase against edge cases involving missing or undefined data.

@aaronzi aaronzi merged commit d6428e3 into eclipse-basyx:main Jan 28, 2026
2 checks passed
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.

2 participants