display tooltip when disabled (#16837)

This commit is contained in:
AAfghahi 2021-09-24 15:56:33 -04:00 committed by GitHub
parent 55e2872dbf
commit 04f7ecad1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -224,7 +224,9 @@ export default function Button(props: ButtonProps) {
id={`${kebabCase(tooltip)}-tooltip`}
title={tooltip}
>
{button}
{/* this ternary wraps the button in a span so that the tooltip shows up
when the button is disabled. */}
{disabled ? <span>{button}</span> : button}
</Tooltip>
);
}