tajo/react-portal

handleoutside not triggering on clicking the sibbling child element it open the both the menu item at once

mani-89 opened this issue · 1 comments

here this is code in menu i have dropdown and portal with state is in dropdown and menu list as children for dropdown like sample

Menu code:

<Dropdown> **//portal with state in drop down**
     <Menulist>
           <Menuitem></Menuitem>
           <Menuitem></Menuitem>
     </Menulist>
</Dropdown>

drop down : code

<PortalWithState
                closeOnEsc={closeOnEsc}
                closeOnOutsideClick={closeOnOutsideClick}
                onOpen={this.onOpen}
                adjustPosition={this.adjustPosition}
                onClose={onClose}
                beforeClose={this.beforeClose}
                isOpened={isOpened}
            >
                {({ openPortal, closePortal, isOpen, portal }) => (

                    <React.Fragment>
                        <Target.type onClick={openPortal} {...target.props} />//target element onclick it opens menu list of items
                        {portal(children)}
                    </React.Fragment>
                )}
            </PortalWithState>

reference this issue #206