ifndefdeadmau5 / react-floating-button-menu

A customizable floating action button menu that follows material design
https://ifndefdeadmau5.github.io/react-floating-button-menu/
46 stars 15 forks source link

Add a link for each child button ? #1

Closed be-next-hotdog closed 7 years ago

be-next-hotdog commented 7 years ago

Yopp, I did not find the props while allow me to add a redirection link for child button ? Thx

ifndefdeadmau5 commented 7 years ago

You can pass onClick handler via props to each button so that implement your custom behaviour


 <ChildButton
        iconButton={MdAdd}
        iconColor="black"
        order={1}
        backgroundColor="white"
        onClick={() => {/* Your custom code goes here */}}
   />
be-next-hotdog commented 7 years ago

Yep, I've tried this way but it will triggers immediately ChildButton onClick event while we click the MainButton and ChildButton is not a subnode of MainButton ... Have you showcase online ?

Thx a lot.

be-next-hotdog commented 7 years ago

I've tried many times, I really had no idea why this triggered automatically the childbutton onclick event while clicking mainbutton.

be-next-hotdog commented 7 years ago

I found out, the ChildButton covers always MainButton as you defined opacity: 0 while the menu is not active. It'd better assign z-index to each component I think.