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

[Table] table cell hover tooltip #5457

Closed
mauvew opened this issue Oct 24, 2016 · 12 comments
Closed

[Table] table cell hover tooltip #5457

mauvew opened this issue Oct 24, 2016 · 12 comments
Labels
component: table This is the name of the generic UI component, not the React module! component: tooltip This is the name of the generic UI component, not the React module!

Comments

@mauvew
Copy link

mauvew commented Oct 24, 2016

Problem description

Is it possible to provide the feature that when the cursor hovers to the table cell in the Table component, a tooltip appears and display the content of the cell. Like the following pic shows, if there is no tooltip, some part of the content will not be visible. Or any suggestion on how to deal with this situation?

image

Versions

  • Material-UI: 0.16.1
  • React:
  • Browser:
@TheoNolasco
Copy link

TheoNolasco commented Oct 24, 2016

Looking for a suggestion as well to make the tooltip more visible in a table. Possibly center-left or center-right?

@oliviertassinari oliviertassinari added the component: table This is the name of the generic UI component, not the React module! label Dec 18, 2016
@oliviertassinari oliviertassinari changed the title [table] table cell hover tooltip [Table] table cell hover tooltip Dec 18, 2016
@lorenzoid
Copy link

+1 on this.

@noopnik
Copy link

noopnik commented Feb 15, 2017

+1

@m2mathew
Copy link
Member

m2mathew commented Feb 28, 2017

As of release v.0.17.0, we can now use tooltipPosition: 'center-right' due to #6072. Good fix!

@jpsantos7
Copy link

Hey guys! this is a good idea but it is not quite working.
I'm getting these warnings:

Invalid prop tooltipPositionof valuecenter-rightsupplied toIconButton, expected one of ["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"]

and

Invalid prop verticalPositionof valuecentersupplied toTooltip, expected one of ["top","bottom"].

Additionally the IconButton is not really clickable once the tooltip is on top of it unfortunately.

Maybe a tooltipPosition: 'center-left' would be also cool for when the IconButton is located on the last <td> and the tooltip gets cut on the right because it goes out of the table.

A solution to the button not being clickable when the tooltip is on top of it would be to make the tooltip appear on the right and/or left of the IconButton instead of on the center.
Just my 2 cents.

@andrewrome
Copy link

andrewrome commented Jul 21, 2017

+1 on this.
The closest I've gotten is

<TableRowColumn 
    onMouseEnter={()=>{this.setState({hoveredTooltip: true})}}
    onMouseLeave={()=>{this.setState({hoveredTooltip: false})}}>
        My text here
</TableRowColumn>
<Tooltip show={this.state.hoveredTooltip}
         label="My label here"
         touch={true}
/>

@oliviertassinari
Copy link
Member

Closing for #2230

@DevJett

This comment has been minimized.

@syedmrizwan
Copy link

Tooltip will be visible by adding TITLE ATTRIBUTE to the TableRowColumn as shown below:
<TableRowColumn title='Text to be displayed in the Tool Tip'>Hover me</TableRowColumn>
image

@TiagoPortfolio
Copy link

Tooltip will be visible by adding TITLE ATTRIBUTE to the TableRowColumn as shown below:
<TableRowColumn title='Text to be displayed in the Tool Tip'>Hover me</TableRowColumn>
image

That's not the material-ui tooltip though...

@royliu007
Copy link

this is what I made in my project:

import Tooltip from '@material-ui/core/Tooltip'
... 
<TableCell>
    <Tooltip title={row.name} placement='right'>
        <div>{  row.name ? row.name.slice(0, 4) + '...' : ' -- ' }</div>
    </Tooltip>
</TableCell>
...

it works like using CSS but with the tooltip to show the whole text
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',

@oliviertassinari oliviertassinari added the component: tooltip This is the name of the generic UI component, not the React module! label Aug 22, 2020
@shubhamkhunt04
Copy link

Adding span as a Tooltip child will works for me

 <Tooltip
     title="Hello tooltip">
         <span>Hello Tooltip</span>
  </Tooltip>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: table This is the name of the generic UI component, not the React module! component: tooltip This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests