Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/components/Toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ export const Toast: React.FC<ToastProps> = props => {
isLoading,
closeOnClick,
theme,
ariaLabel
ariaLabel,
isFocusable
} = props;
const defaultClassName = cx(
`${Default.CSS_NAMESPACE}__toast`,
Expand Down Expand Up @@ -81,7 +82,7 @@ export const Toast: React.FC<ToastProps> = props => {
>
<div
id={toastId as string}
tabIndex={0}
tabIndex={isFocusable !== false ? 0 : -1}
onClick={onClick}
data-in={isIn}
className={cssClasses}
Expand Down
6 changes: 6 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ export interface ToastOptions<Data = unknown> extends CommonOptions {
delay?: number;

isLoading?: boolean;

/**
* If true, the toast will be focusable.
* Default: true
*/
isFocusable?: boolean;
}

export interface UpdateOptions<T = unknown> extends Nullable<ToastOptions<T>> {
Expand Down