tajo / react-portal

🎯 React component for transportation of modals, lightboxes, loading bars... to document.body or else.
MIT License
2.14k stars 169 forks source link

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

Closed mani-89 closed 5 years ago

mani-89 commented 5 years ago

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>
mani-89 commented 5 years ago

reference this issue #206