Skip to content

Commit

Permalink
fix(CSidebar): onShowChange callback behavior overwritten for overlaid
Browse files Browse the repository at this point in the history
  • Loading branch information
xidedix committed Oct 15, 2020
1 parent 9c84573 commit c463ea5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/template/CSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,11 @@ const CSidebar = props => {
}

const closeSidebar = () => {
onShowChange && onShowChange(overlaid ? false : 'responsive')
setIsOpen(overlaid ? false : 'responsive')
if (typeof onShowChange === 'function') {
onShowChange(overlaid ? false : 'responsive')
} else {
setIsOpen(overlaid ? false : 'responsive')
}
}

const isOnMobile = () => {
Expand Down

0 comments on commit c463ea5

Please sign in to comment.