diff --git a/src/picker/index.js b/src/picker/index.js index 805a0062f..5b5a379b1 100644 --- a/src/picker/index.js +++ b/src/picker/index.js @@ -86,7 +86,15 @@ export default createComponent({ let cursor = { children: this.columns }; while (cursor && cursor.children) { - const defaultIndex = cursor.defaultIndex ?? +this.defaultIndex; + const { children } = cursor; + let defaultIndex = cursor.defaultIndex ?? +this.defaultIndex; + + while ( + children[defaultIndex].disabled && + defaultIndex < children.length - 1 + ) { + defaultIndex++; + } formatted.push({ values: cursor.children, @@ -94,7 +102,7 @@ export default createComponent({ defaultIndex, }); - cursor = cursor.children[defaultIndex]; + cursor = children[defaultIndex]; } this.formattedColumns = formatted; diff --git a/src/picker/test/__snapshots__/cascade.spec.js.snap b/src/picker/test/__snapshots__/cascade.spec.js.snap index c6decf9d7..09e3c4952 100644 --- a/src/picker/test/__snapshots__/cascade.spec.js.snap +++ b/src/picker/test/__snapshots__/cascade.spec.js.snap @@ -5,3 +5,34 @@ exports[`disabled in cascade 1`] = `