fix: Deep copy options used by dropdown fields (#6425)

This uncovered a broken test that was only passing because of a side effect of the dropdown option data getting modified.
This commit is contained in:
Neil Fraser
2022-09-13 22:29:38 +02:00
committed by GitHub
parent e3fa43d861
commit 05b221b1d6
2 changed files with 3 additions and 1 deletions

View File

@@ -125,6 +125,8 @@ export class FieldDropdown extends Field {
if (Array.isArray(menuGenerator)) {
validateOptions(menuGenerator);
// Deep copy the option structure so it doesn't change.
menuGenerator = JSON.parse(JSON.stringify(menuGenerator));
}
/**