Skip to content

Commit 9d835e0

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

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/offcanvas/COffcanvas.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export interface COffcanvasProps extends HTMLAttributes<HTMLDivElement> {
2323
/**
2424
* Method called before the dissmiss animation has started.
2525
*/
26-
onDismiss?: () => void
26+
onClose?: () => void
2727
/**
2828
* Components placement, there’s no default placement.
2929
*/
@@ -49,7 +49,7 @@ export const COffcanvas = forwardRef<HTMLDivElement, COffcanvasProps>(
4949
backdrop = true,
5050
className,
5151
keyboard = true,
52-
onDismiss,
52+
onClose,
5353
placement,
5454
portal = true,
5555
scroll = false,
@@ -99,7 +99,7 @@ export const COffcanvas = forwardRef<HTMLDivElement, COffcanvasProps>(
9999

100100
const handleDismiss = () => {
101101
setVisible(false)
102-
return onDismiss && onDismiss()
102+
return onClose && onClose()
103103
}
104104

105105
const handleKeyDown = useCallback(
@@ -152,7 +152,7 @@ COffcanvas.propTypes = {
152152
children: PropTypes.node,
153153
className: PropTypes.string,
154154
keyboard: PropTypes.bool,
155-
onDismiss: PropTypes.func,
155+
onClose: PropTypes.func,
156156
placement: PropTypes.oneOf<'start' | 'end' | 'top' | 'bottom'>(['start', 'end', 'top', 'bottom'])
157157
.isRequired,
158158
portal: PropTypes.bool,

0 commit comments

Comments
 (0)