8000 refactor(CModal): rename `onDismiss` to `onClose` · v-rr/coreui-react@9747440 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9747440

Browse files
committed
refactor(CModal): rename onDismiss to onClose
1 parent 9d835e0 commit 9747440

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/components/modal/CModal.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export interface CModalProps extends HTMLAttributes<HTMLDivElement> {
4747
/**
4848
* Method called before the dissmiss animation has started.
4949
*/
50-
onDismiss?: () => void
50+
onClose?: () => void
5151
/**
5252
* Generates modal using createPortal.
5353
*/
@@ -87,7 +87,7 @@ export const CModal = forwardRef<HTMLDivElement, CModalProps>(
8787
duration = 150,
8888
fullscreen,
8989
keyboard = true,
90-
onDismiss,
90+
onClose,
9191
portal = true,
9292
scrollable,
9393
size,
@@ -115,7 +115,7 @@ export const CModal = forwardRef<HTMLDivElement, CModalProps>(
115115
if (backdrop === 'static') {
116116
return setStaticBackdrop(true)
117117
}
118-
return onDismiss && onDismiss()
118+
return onClose && onClose()
119119
}
120120

121121
useLayoutEffect(() => {
@@ -194,7 +194,7 @@ export const CModal = forwardRef<HTMLDivElement, CModalProps>(
194194
<CSSTransition
195195
in={_visible}
196196
timeout={!transition ? 0 : duration}
197-
onExit={onDismiss}
197+
onExit={onClose}
198198
mountOnEnter
199199
unmountOnExit
200200
>
@@ -225,7 +225,7 @@ CModal.propTypes = {
225225
PropTypes.oneOf<'sm' | 'md' | 'lg' | 'xl' | 'xxl'>(['sm', 'md', 'lg', 'xl', 'xxl']),
226226
]),
227227
keyboard: PropTypes.bool,
228-
onDismiss: PropTypes.func,
228+
onClose: PropTypes.func,
229229
portal: PropTypes.bool,
230230
scrollable: PropTypes.bool,
231231
size: PropTypes.oneOf(['sm', 'lg', 'xl']),

0 commit comments

Comments
 (0)
0