Skip to content

Commit c12b542

Browse files
committed
Fix loading selector with children starting at the same digit
1 parent 9778a4c commit c12b542

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

components/dash-core-components/src/components/Loading.react.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ const coveringSpinner = {
3131

3232
const loadingSelector = (componentPath, targetComponents) => state => {
3333
let stringPath = JSON.stringify(componentPath);
34-
// Remove the last ] for easy match
35-
stringPath = stringPath.substring(0, stringPath.length - 1);
34+
// Remove the last ] for easy match and add `,` to make sure only children
35+
// trigger the loading. See issue: https://github.com/plotly/dash/issues/3276
36+
stringPath = stringPath.substring(0, stringPath.length - 1) + ',';
3637
const loadingChildren = toPairs(state.loading).reduce(
3738
(acc, [path, load]) => {
3839
if (path.startsWith(stringPath) && load.length) {

0 commit comments

Comments
 (0)