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

Popover doesn't work in modal #1685

Closed
flash1293 opened this issue Mar 6, 2019 · 6 comments
Closed

Popover doesn't work in modal #1685

flash1293 opened this issue Mar 6, 2019 · 6 comments
Labels

Comments

@flash1293
Copy link
Contributor

Elements inside a popover are not clickable if the popover resides inside a modal.

<EuiModal>
  <EuiModalBody>
    <EuiPopover
      button={<button>My Button</button>}
      isOpen={true}
      repositionOnScroll
    >
      <button onClick={() => {alert('test'); /* won't fire */}}>Click me</button>
    </EuiPopover>
  </EuiModalBody>
</EuiModal>

It works fine if the popover is used directly on the page.

@timroes timroes added the bug label Mar 6, 2019
@timroes
Copy link
Contributor

timroes commented Mar 6, 2019

@cchaos that's a bit critical for us at the moment, since we would need the dialog in elastic/kibana#31400 to show the filters in the "new vis / choose source". Since that PR is critical for the Geo team, to be able to add Maps to dashboards, I wondered, if it would be possible, you could raise this issue somehow to urgent?

@timroes
Copy link
Contributor

timroes commented Mar 6, 2019

The issue - as far as I see it - is btw caused by multiple OutsideClick detectors who are conflicting with each other. So the modal's OutsideClickDetector actually catches the click inside the popover (even though that's part of the modal).

@cchaos
Copy link
Contributor

cchaos commented Mar 6, 2019

I'm not as familiar with the focus trap/portal stuff, but I know that canvas is using a popover in a modal. So there must just be an extra setting needed?
screen shot 2019-03-06 at 10 21 01 am

@snide
Copy link
Contributor

snide commented Mar 6, 2019 via email

@thompsongl
Copy link
Contributor

@timroes What @snide said is accurate. Better portal support was recently added.
FWIW, here's your test case reproduced in our docs environment with the latest EUI:

kapture 2019-03-06 at 9 34 31

@snide snide closed this as completed Mar 6, 2019
@timroes
Copy link
Contributor

timroes commented Mar 6, 2019

Awesome @snide thanks for the quick feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants