Skip to content

[pull] main from coreui:main #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Sep 21, 2024
Next Next commit
fix special key prop in CToast
  • Loading branch information
jasperfirecai2 committed Aug 16, 2024
commit 8b25a39b2618ca088cb84d7c176a94e32a614084
11 changes: 7 additions & 4 deletions packages/coreui-react/src/components/toast/CToast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export interface CToastProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title
/**
* @ignore
*/
key?: number
innerKey?: number | string
/**
* Callback fired when the component requests to be closed.
*/
Expand Down Expand Up @@ -76,7 +76,7 @@ export const CToast = forwardRef<HTMLDivElement, CToastProps>(
color,
delay = 5000,
index,
key,
innerKey,
visible = false,
onClose,
onShow,
Expand Down Expand Up @@ -143,7 +143,7 @@ export const CToast = forwardRef<HTMLDivElement, CToastProps>(
onMouseEnter={() => clearTimeout(timeout.current)}
onMouseLeave={() => _autohide()}
{...rest}
key={key}
key={innerKey}
ref={forkedRef}
>
{children}
Expand All @@ -163,7 +163,10 @@ CToast.propTypes = {
color: colorPropType,
delay: PropTypes.number,
index: PropTypes.number,
key: PropTypes.number,
innerKey: PropTypes.oneOfType([
PropTypes.number,
PropTypes.string
]),
onClose: PropTypes.func,
onShow: PropTypes.func,
visible: PropTypes.bool,
Expand Down