Skip to content

Commit 6a10cd4

Browse files
committed
Added mandatory tooltip support for the iconOnly button
1 parent 019cfcc commit 6a10cd4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/ui/src/components/button.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ const Button = forwardRef<HTMLButtonElement, ButtonProps>(
141141
children: _children,
142142
type = 'button',
143143
tooltipProps,
144+
ignoreIconOnlyTooltip: _,
144145
...props
145146
},
146147
ref
@@ -198,11 +199,11 @@ type ButtonLike = Omit<Partial<ButtonProps>, 'iconOnly' | 'ignoreIconOnlyTooltip
198199
}
199200

200201
const toButtonProps = (p: ButtonLike) => {
201-
if (p.iconOnly) {
202+
if (p?.iconOnly) {
202203
return {
203204
...p,
204205
iconOnly: true,
205-
ignoreIconOnlyTooltip: (p as any).ignoreIconOnlyTooltip ?? false
206+
ignoreIconOnlyTooltip: (p as any)?.ignoreIconOnlyTooltip ?? false
206207
} as BtnIconOnly
207208
}
208209

0 commit comments

Comments
 (0)