Skip to content

Commit c463ea5

Browse files
committed
fix(CSidebar): onShowChange callback behavior overwritten for overlaid
1 parent 9c84573 commit c463ea5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/template/CSidebar.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,11 @@ const CSidebar = props => {
9595
}
9696

9797
const closeSidebar = () => {
98-
onShowChange && onShowChange(overlaid ? false : 'responsive')
99-
setIsOpen(overlaid ? false : 'responsive')
98+
if (typeof onShowChange === 'function') {
99+
onShowChange(overlaid ? false : 'responsive')
100+
} else {
101+
setIsOpen(overlaid ? false : 'responsive')
102+
}
100103
}
101104

102105
const isOnMobile = () => {

0 commit comments

Comments
 (0)