Skip to content

Can't close the popover when clicking outside of it on an SVG element. #549

@kachurun

Description

@kachurun

Describe the bug

The popover does not close when clicking an SVG element outside of it.

To Reproduce

<svg width="14" height="18" viewBox="0 0 14 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.7873 6.90807C11.6815 6.2693 12 5.56717 12 5C12 4.43283 11.6815 3.7307 10.7873 3.09193C9.89684 2.45591 8.56421 2 7 2C5.43579 2 4.10316 2.45591 3.21273 3.09193C2.31845 3.7307 2 4.43283 2 5C2 5.56717 2.31845 6.2693 3.21273 6.90807C4.10316 7.54409 5.43579 8 7 8C8.56421 8 9.89684 7.54409 10.7873 6.90807ZM7 10C8.95869 10 10.7295 9.42538 12 8.49927V9C12 9.56717 11.6815 10.2693 10.7873 10.9081C9.89684 11.5441 8.56421 12 7 12C5.43579 12 4.10316 11.5441 3.21273 10.9081C2.31845 10.2693 2 9.56717 2 9V8.49927C3.27052 9.42538 5.04131 10 7 10ZM12 12.4993C10.7295 13.4254 8.95869 14 7 14C5.04131 14 3.27052 13.4254 2 12.4993V13C2 13.5672 2.31845 14.2693 3.21273 14.9081C4.10316 15.5441 5.43579 16 7 16C8.56421 16 9.89684 15.5441 10.7873 14.9081C11.6815 14.2693 12 13.5672 12 13V12.4993ZM14 9V13C14 15.7614 10.866 18 7 18C3.13401 18 0 15.7614 0 13V9V5C0 2.23858 3.13401 0 7 0C10.866 0 14 2.23858 14 5V9Z" fill="#30343B"/>
</svg>
  • Open any popover
  • Click the SVG icon to close the popover.

This caused by this check:

if (!(target instanceof HTMLElement)) {
    return false;
}

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