Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Unable to toggle Popover in React 17 #1574

Closed
scurker opened this issue Jul 10, 2024 · 0 comments · Fixed by #1680
Closed

Bug: Unable to toggle Popover in React 17 #1574

scurker opened this issue Jul 10, 2024 · 0 comments · Fixed by #1680
Labels
bug Something isn't working
Milestone

Comments

@scurker
Copy link
Member

scurker commented Jul 10, 2024

Steps to reproduce

Have React 17 installed/running with the latest version of Cauldron. Have a Popover with a triggered button:

function Example() {
  const [show, setShow] = useState(false);
  const onTogglePopover = () => setShow(!show);
  const buttonRef = useRef();

  return (
    <>
      <Button 
        onClick={onTogglePopover} 
        variant="secondary" 
        buttonRef={buttonRef}
      >
        Prompt!
      </Button>
      <Popover
        variant="prompt"
        target={buttonRef} 
        placement="auto" 
        show={show} 
        onClose={onTogglePopover}
        infoText="Are you sure you want to exit this wizard? All changes will be lost."
      />
    </>
  )
}

Expected Behavior

The popover should appear when the button is clicked.

Actual Behavior

The popover does not appear.

Anything else we should know?

This is likely related to #1087 and #830. All of these components use ClickOutsideListener where the listener is activated preventing the actions from occurring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant