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; };