Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menu auto-reopens when using SVG as center piece #2

Open
MagicIndustries opened this issue Oct 3, 2020 · 0 comments
Open

Menu auto-reopens when using SVG as center piece #2

MagicIndustries opened this issue Oct 3, 2020 · 0 comments

Comments

@MagicIndustries
Copy link

I have a menu of hexes I've created using Planet, with the center hex showing an image. I use react-hexagon (https://github.com/rexxars/react-hexagon) and when it is the center element, the menu won't close properly.

Example with hex:
with_hex

<Planet
    centerContent={
       <MenuAvatar />
    }
    open
    orbitRadius={220}
  autoClose>
           <MenuButton />
           <MenuButton />
           <MenuButton />
           <MenuButton />
           <MenuButton />
           <MenuButton />
</Planet>

MenuAvatar component:

const HexDiv = styled.div`
  width: ${HEX_WIDTH};
  max-width: ${HEX_WIDTH};
  height: ${HEX_HEIGHT};
  max-height: ${HEX_HEIGHT};
  position: relative;
`;

class MenuAvatar extends Component {

  render() {
      return (
        <HexDiv>
          <Hexagon
            style={{stroke: '#000000', strokeWidth: '0', width: '100px', height: '100px' }}
            backgroundImage={avatar}
            backgroundScale={1.1}
            flatTop={true}
            href="/personas/current"
          />
        </HexDiv>
      )
  }
}

Example without hex:
without_hex

MenuAvatar component

const HexDiv = styled.div`
  width: ${HEX_WIDTH};
  max-width: ${HEX_WIDTH};
  height: ${HEX_HEIGHT};
  max-height: ${HEX_HEIGHT};
  position: relative;
`;

class MenuAvatar extends Component {

  render() {
      return (
        <HexDiv>
          <div style={{width: '100px', height: '100px', backgroundColor: '#000'}}></di
        </HexDiv>
      )
  }
}

Hexagon is basically created an svg in a div, with an image background. Any idea what's breaking the menu?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant