helgastogova / react-stateful-bottom-sheet

React Stateful Bottom Sheet is a versatile React component that provides a bottom sheet functionality with the ability to pass the open/closed state to its child components.
MIT License
0 stars 1 forks source link

setOpen(true) doesn't seem to work #1

Closed costyn closed 1 year ago

costyn commented 1 year ago

Hello! First of all, very nice library, thanks for sharing.

I'm trying to also include a button on the drawer which will open the drawer which will have search filters on it. Doing a setOpen(true) doesn't seem to work, unfortunately (while setOpen(false) does).

<BottomSheet>
  {({ isOpen, setOpen }) => (
      <div>
          <FilterTagGroup onChange={onChangeSelect} urlSearchParams={urlSearchParams} />
          <ButtonSecondary
              variant={'on-light'}
              onClick={() => setOpen(!isOpen)}>
              {isOpen ? 'Close Filters' : 'Open Filters'}
          </ButtonSecondary>
      </div>
  )}
</BottomSheet>

Am I doing something wrong?

Thanks

helgastogova commented 1 year ago

Hi @costyn, thank you for your report. checking...

helgastogova commented 1 year ago

checked,

@costyn thank you again 🙌 , made a fix

please update to 1.1.8 and everything should be fine

checked it here with a new version

costyn commented 1 year ago

Hi @helgastogova, that was very, very quick! I had made the same fix to local copy, works fine yes!