@@ -283,47 +283,39 @@ function BaseButton({
283283 // Buttons come in 4 flavors: <Link>, <ExternalLink>, <a>, and <button>.
284284 // Let's use props to determine which to serve up, so we don't have to think about it.
285285 // *Note* you must still handle tabindex manually.
286- const button = (
287- < StyledButton
288- aria-label = { accessibleLabel }
289- aria-disabled = { disabled }
290- busy = { busy }
291- disabled = { disabled }
292- to = { disabled ? undefined : to }
293- href = { disabled ? undefined : href }
294- replace = { replace }
295- size = { size }
296- priority = { priority }
297- borderless = { borderless }
298- translucentBorder = { translucentBorder }
299- type = { type }
300- { ...buttonProps }
301- onClick = { handleClick }
302- role = "button"
303- >
304- { priority !== 'link' && (
305- < InteractionStateLayer
306- higherOpacity = { priority && [ 'primary' , 'danger' ] . includes ( priority ) }
307- />
308- ) }
309- < ButtonLabel size = { size } borderless = { borderless } >
310- { icon && (
311- < Icon size = { size } hasChildren = { hasChildren } >
312- < IconDefaultsProvider size = { ICON_SIZES [ size ] } > { icon } </ IconDefaultsProvider >
313- </ Icon >
314- ) }
315- { children }
316- </ ButtonLabel >
317- </ StyledButton >
318- ) ;
319-
320- if ( ! title ) {
321- return button ;
322- }
323-
324286 return (
325- < Tooltip skipWrapper { ...tooltipProps } title = { title } >
326- { button }
287+ < Tooltip skipWrapper { ...tooltipProps } title = { title } disabled = { ! title } >
288+ < StyledButton
289+ aria-label = { accessibleLabel }
290+ aria-disabled = { disabled }
291+ busy = { busy }
292+ disabled = { disabled }
293+ to = { disabled ? undefined : to }
294+ href = { disabled ? undefined : href }
295+ replace = { replace }
296+ size = { size }
297+ priority = { priority }
298+ borderless = { borderless }
299+ translucentBorder = { translucentBorder }
300+ type = { type }
301+ { ...buttonProps }
302+ onClick = { handleClick }
303+ role = "button"
304+ >
305+ { priority !== 'link' && (
306+ < InteractionStateLayer
307+ higherOpacity = { priority && [ 'primary' , 'danger' ] . includes ( priority ) }
308+ />
309+ ) }
310+ < ButtonLabel size = { size } borderless = { borderless } >
311+ { icon && (
312+ < Icon size = { size } hasChildren = { hasChildren } >
313+ < IconDefaultsProvider size = { ICON_SIZES [ size ] } > { icon } </ IconDefaultsProvider >
314+ </ Icon >
315+ ) }
316+ { children }
317+ </ ButtonLabel >
318+ </ StyledButton >
327319 </ Tooltip >
328320 ) ;
329321}
0 commit comments