Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Popup not closing when in Menu #557

@johannao76

Description

@johannao76

Bug Report

Steps

When using Popup with Menu, clicking on a menu item when another menu item's popup is open, will not close the original item. Use this code snippet in the docs site:

import React from 'react'
import { Menu, Popup} from '@stardust-ui/react'

const items = [
  { key: 'editorials', content: 'Editorials' },
  { key: 'review', content: 'Reviews' },
  { key: 'events', content: 'Upcoming Events' },
]

const MenuExample = () => <Menu defaultActiveIndex={0} items={items} renderItem={renderItem}/>

const renderItem = (MenuItem, props) => {
  return (
    <Popup 
      trigger={<MenuItem {...props} />}
      content={{content: "TestContent"}}
    />
  )
}

export default MenuExample

Expected Result

When a menu item's popup is open, clicking on another menu item should close the popup and open the clicked item's popup.

Actual Result

We end up with two open popups

Version

0.13.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    vstsPaired with ticket in vsts

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions