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

IconButton - Problem with rendering <Link> as containerElement #908

Closed
mairh opened this issue Jun 22, 2015 · 5 comments
Closed

IconButton - Problem with rendering <Link> as containerElement #908

mairh opened this issue Jun 22, 2015 · 5 comments
Labels
component: icon button This is the name of the generic UI component, not the React module! component: link This is the name of the generic UI component, not the React module!

Comments

@mairh
Copy link

mairh commented Jun 22, 2015

We have recently fixed the way to render react router <Link> element inside a button component. Issue - #850

However, I am having trouble wrapping containerElement inside IconButton component. I am not exctly sure where am I going wrong and there seems to be some style issues : I am not able to render the link if I click on the icon. However, it does work if I click outside the icon boundary.

Here is the screencast link:

http://screencast-o-matic.com/watch/co13IKfYZk

The way I am implementing containerElement is as follows:

<IconButton
    containerElement={<Link to="signin" />}
    tooltip="Sign in"
    linkButton={true}>
        <i className="material-icons">face</i>
</IconButton>
@mairh
Copy link
Author

mairh commented Jun 23, 2015

@hai-cea - Any suggestions?

@hai-cea
Copy link
Member

hai-cea commented Jun 24, 2015

@mairh Could be some extra styles on that className? I tried this on the docs site and it worked fine:

<IconButton
  containerElement={<Link to="home" />}
  tooltip="home"
  linkButton={true}>
  <ActionFace />
</IconButton>

This is using SvgIcons which you might consider using since we have all the icons in the project now. Here's the one you need: https://github.com/callemall/material-ui/blob/master/src/svg-icons/action/face.jsx

@mairh
Copy link
Author

mairh commented Jun 24, 2015

It could be the style problem from google material icons hosted stylesheet. I guess I will end up using SvgIcons for <IconButton>. Since the icons has been recently added I should wait for another release.

@mairh
Copy link
Author

mairh commented Jul 22, 2015

Closing the issue since it has been fixed in last release.

@mairh mairh closed this as completed Jul 22, 2015
@hai-cea
Copy link
Member

hai-cea commented Jul 22, 2015

Thanks @mairh

mnajdova pushed a commit to mnajdova/material-ui that referenced this issue Nov 10, 2020
@oliviertassinari oliviertassinari added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 25, 2022
@zannager zannager added component: icon button This is the name of the generic UI component, not the React module! component: link This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: icon button This is the name of the generic UI component, not the React module! component: link This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

4 participants