Don't allow input error to be dismissed

This commit is contained in:
tidy-dev 2023-12-05 09:12:36 -05:00
parent 54a4ebbf13
commit cee75ab913
3 changed files with 20 additions and 0 deletions

View file

@ -1258,6 +1258,7 @@ export class CommitMessage extends React.Component<
onClick={this.onSubmit}
disabled={!buttonEnabled}
tooltip={tooltip}
tooltipDismissable={false}
onlyShowTooltipWhenOverflowed={buttonEnabled}
>
<>

View file

@ -180,6 +180,15 @@ export interface IButtonProps {
* Default: true
* */
readonly applyTooltipAriaDescribedBy?: boolean
/**
* Whether or not the tooltip should be dismissable via the escape key. This
* is generally true, but if the tooltip is communicating something important
* to the user, such as an input error, it should not be dismissable.
*
* Defaults to true
*/
readonly tooltipDismissable?: boolean
}
/**
@ -251,6 +260,7 @@ export class Button extends React.Component<IButtonProps, {}> {
onlyWhenOverflowed={this.props.onlyShowTooltipWhenOverflowed}
openOnTargetClick={this.props.openTooltipOnClick}
applyAriaDescribedBy={this.props.applyTooltipAriaDescribedBy}
dismissable={this.props.tooltipDismissable}
>
{tooltip}
</Tooltip>

View file

@ -53,6 +53,15 @@ export interface ITooltipProps<T> {
*/
readonly interactive?: boolean
/**
* Whether or not the tooltip should be dismissable via the escape key. This
* is generally true, but if the tooltip is communicating something important
* to the user, such as an input error, it should not be dismissable.
*
* Defaults to true
*/
readonly dismissable?: boolean
/**
* The amount of time to wait (in milliseconds) while a user hovers over the
* target before displaying the tooltip. There's typically no reason to