Skip to content

isNonModal prop in <Popover /> (react-aria-components) is not working #6819

Closed
@rafighajili

Description

@rafighajili

Provide a general summary of the issue here

import { Button, Dialog, DialogTrigger, OverlayArrow, Popover, Switch } from "react-aria-components";

<DialogTrigger>
  <Button>Settings</Button>
  <Popover isNonModal>
    <OverlayArrow>
      <svg width={12} height={12} viewBox="0 0 12 12">
        <path d="M0 0 L6 6 L12 0" />
      </svg>
    </OverlayArrow>
    <Dialog>
      <div className="flex-col">
        <Switch defaultSelected>
          <div className="indicator" /> Wi-Fi
        </Switch>
        <Switch defaultSelected>
          <div className="indicator" /> Bluetooth
        </Switch>
        <Switch>
          <div className="indicator" /> Mute
        </Switch>
      </div>
    </Dialog>
  </Popover>
</DialogTrigger>

🤔 Expected Behavior?

since there is isNonModal prop, it should close on scroll, or on click outside.

😯 Current Behavior

it closes on scroll, but is not closing when clicking outside, or clicking button itself.

💁 Possible Solution

No response

🔦 Context

No response

🖥️ Steps to Reproduce

i used the code on documentation, https://react-spectrum.adobe.com/react-aria/Popover.html. just added isNonModal prop.

Version

1.0.1

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

mac

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions