Skip to content

Commit

Permalink
fix(cascader): onPathChange is not a function (#2308)
Browse files Browse the repository at this point in the history
  • Loading branch information
oasis-cloud authored May 31, 2024
1 parent bea6287 commit 08825c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/packages/cascader/cascader.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ const InternalCascader: ForwardRefRenderFunction<
const pathNodes = state.panes.map((item) => item.selectedNode)
const optionParams = pathNodes.map((item: any) => item.value)
onChange(optionParams, pathNodes)
onPathChange(optionParams, pathNodes)
onPathChange?.(optionParams, pathNodes)
setInnerValue(optionParams)
}
setOptionsData(state.panes)
Expand All @@ -353,7 +353,7 @@ const InternalCascader: ForwardRefRenderFunction<
if (!type) {
const pathNodes = state.panes.map((item) => item.selectedNode)
const optionParams = pathNodes.map((item: any) => item?.value)
onPathChange(optionParams, pathNodes)
onPathChange?.(optionParams, pathNodes)
}
return
}
Expand Down
4 changes: 2 additions & 2 deletions src/packages/cascader/cascader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ const InternalCascader: ForwardRefRenderFunction<
const pathNodes = state.panes.map((item) => item.selectedNode)
const optionParams = pathNodes.map((item: any) => item.value)
onChange(optionParams, pathNodes)
onPathChange(optionParams, pathNodes)
onPathChange?.(optionParams, pathNodes)
setInnerValue(optionParams)
}
setOptionsData(state.panes)
Expand All @@ -352,7 +352,7 @@ const InternalCascader: ForwardRefRenderFunction<
if (!type) {
const pathNodes = state.panes.map((item) => item.selectedNode)
const optionParams = pathNodes.map((item: any) => item?.value)
onPathChange(optionParams, pathNodes)
onPathChange?.(optionParams, pathNodes)
}
return
}
Expand Down

0 comments on commit 08825c1

Please sign in to comment.