Skip to content

Commit

Permalink
fix(comp:table): clicking expand icon shouldn't trigger row select (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sallerli1 committed Apr 8, 2024
1 parent 73c4f11 commit 818722e
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions packages/components/table/src/main/body/BodyCell.tsx
Expand Up @@ -255,14 +255,19 @@ function renderExpandableChildren(
}
}

const handleClick = (evt: MouseEvent) => {
evt.preventDefault()
evt.stopImmediatePropagation()

if (!expandDisabled.value) {
handleExpend()
}
}

return [
...indents,
<span class={triggerCls} style={indentStyle}>
<button
class={`${prefixCls}-expandable-trigger-button`}
type="button"
onClick={expandDisabled.value ? undefined : handleExpend}
>
<button class={`${prefixCls}-expandable-trigger-button`} type="button" onClick={handleClick}>
{iconNode}
</button>
{mergedShowLine && [
Expand Down

0 comments on commit 818722e

Please sign in to comment.