Fix issue with repeatable scrollable dropdowns in the submission#830
Merged
tdonohue merged 3 commits intoDSpace:mainfrom Aug 6, 2020
Merged
Fix issue with repeatable scrollable dropdowns in the submission#830tdonohue merged 3 commits intoDSpace:mainfrom
tdonohue merged 3 commits intoDSpace:mainfrom
Conversation
…ropdown would only add the last field
tdonohue
approved these changes
Aug 6, 2020
Member
tdonohue
left a comment
There was a problem hiding this comment.
👍 Tested and this fixes the issues with repeatable dropdown fields. The default Type field now works properly, including drag & drop reordering. I tested other fields as well and found no new problems.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
References
Description
The reason for the error was that the value returned for scrollable dropdowns was bound to the field, and therefore readonly. So cloning it before trying to modify it fixed the exception.
Afterwards I found another issue with scrollable dropdowns where if the field is empty, and you add multiple values before the first (auto)save, only the last would be saved. This was because when a field was added, the formControl wasn't updated like it was for other fields because the values had a different format compared to all the other fields. I added a section to update the formcontrol value in the correct format.
Instructions for Reviewers
To test this PR verify that repeatable scrollable dropdowns work as they should, and that no new issues have been introduced.
Checklist
yarn run lintpackage.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.