Fix issue with setting dynamic triggers on immutable widget objects (#1137)

This commit is contained in:
Hetu Nandu 2020-10-12 12:36:58 +05:30 committed by GitHub
parent fe58aa4ad8
commit 37f40fcc70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -541,7 +541,9 @@ function* updateDynamicTriggers(
widget.type,
);
if (propertyName in triggerProperties) {
let dynamicTriggers: Record<string, true> = widget.dynamicTriggers || {};
let dynamicTriggers: Record<string, true> = widget.dynamicTriggers
? { ...widget.dynamicTriggers }
: {};
if (propertyValue && !(propertyName in dynamicTriggers)) {
dynamicTriggers[propertyName] = true;
}