From 0089af07abeb7b6949f7d99c9037e2ce4002dfe2 Mon Sep 17 00:00:00 2001 From: AnnMarueW Date: Fri, 7 Nov 2025 14:59:25 -0800 Subject: [PATCH] Clear child layout hashes when children prop changes. --- dash/dash-renderer/src/reducers/reducer.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/dash/dash-renderer/src/reducers/reducer.js b/dash/dash-renderer/src/reducers/reducer.js index 56d2c82ad2..fc75ee2d81 100644 --- a/dash/dash-renderer/src/reducers/reducer.js +++ b/dash/dash-renderer/src/reducers/reducer.js @@ -1,4 +1,13 @@ -import {forEach, includes, isEmpty, keys, path, assoc, pathOr} from 'ramda'; +import { + forEach, + includes, + isEmpty, + keys, + path, + assoc, + pathOr, + pickBy +} from 'ramda'; import {combineReducers} from 'redux'; import {getCallbacksByInput} from '../actions/dependencies_ts'; @@ -49,6 +58,14 @@ const layoutHashes = (state = {}, action) => { }, state ); + + if ('children' in action.payload.props) { + // clear all child paths hashes + const childrenPath = stringifyPath( + actionPath.concat(['props', 'children']) + ); + state = pickBy((_, key) => !key.startsWith(childrenPath), state); + } } return state; };