Skip to content

Commit dfaf5d1

Browse files
committed
Fix case where the dict id contains a dot
1 parent b12c481 commit dfaf5d1

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

dash/dash-renderer/src/actions/callbacks.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -340,15 +340,19 @@ function updateComponent(component_id: any, props: any) {
340340

341341
function sideUpdate(outputs: any, dispatch: any) {
342342
toPairs(outputs).forEach(([id, value]) => {
343-
let componentId, propName;
344-
if (id.includes('.')) {
343+
let componentId = id,
344+
propName;
345+
346+
if (id.startsWith('{')) {
347+
const index = id.lastIndexOf('}');
348+
if (index + 2 < id.length) {
349+
propName = id.substring(index + 2);
350+
componentId = JSON.parse(id.substring(0, index + 1));
351+
} else {
352+
componentId = JSON.parse(id);
353+
}
354+
} else if (id.includes('.')) {
345355
[componentId, propName] = id.split('.');
346-
} else {
347-
componentId = id;
348-
}
349-
350-
if (componentId.startsWith('{')) {
351-
componentId = JSON.parse(componentId);
352356
}
353357

354358
const props = propName ? {[propName]: value} : value;

0 commit comments

Comments
 (0)