filestack-react icon indicating copy to clipboard operation
filestack-react copied to clipboard

Once closed it cannot be reopened

Open haris316 opened this issue 3 years ago • 2 comments

Capture What I am trying to do is display a picker overlay on a button click. Once the Overlay appears and a user mistakenly closes it, there is no option to re-render it.

I have already tried onClose but it does not matter if my local variable is set to false. The component does not appear.

Any help would be appreciated..

haris316 avatar Jun 01 '22 12:06 haris316

import { PickerOverlay } from 'filestack-react';

function MyComponent(): JSX.Element {
  const [isOpen, setIsOpen] = setState<boolean>(false);

  const pickerOptions = {
    onClose,
  };

  function onClose() {
    setIsOpen(false);
  }

  function open() {
    setIsOpen(true);
  }

  return (
    <>
      { isOpen && (
        <div style="position:absolute">
          <PickerOverlay apiKey={MY_KEY} pickerOptions={pickerOptions} />
        </div>
      )}
      <button onClick={open}>Upload</open>
    </>
  );
}

peterjhart avatar Dec 09 '22 05:12 peterjhart

Wish this was an example in the readme.

jared-christensen avatar Dec 28 '23 15:12 jared-christensen