Giter VIP home page Giter VIP logo

Comments (10)

currentoor avatar currentoor commented on July 23, 2024 2

Also it looks like the example is broken. The first 15 rows have tooltips, but rows 16 to 27 do not have tool tips, even though from the code it looks like they are supposed. Could this have something to do with the DOM nodes being recycled.

But if I scroll to rows 16 to 27, then call ReactTooltip.rebuild() then they have tooltips as expected. Any suggestions for how to proceed? I suppose I could call ReactTooltip.rebuild() onScrollEnd.

from fixed-data-table-2.

KamranAsif avatar KamranAsif commented on July 23, 2024

We've been struggling with this problem as well.
You don't want rows to overflow on top of one another, which is why rowsContainer has overflow set to hidden.

The solution is to have overflow disabled per cell, set rowsContainer to allow visible, and have classes for cells that have the tooltip.
You also need to bump the z-index of the hovered row

  .fixedDataTableLayout_rowsContainer {
    overflow: visible;
  }

  .fixedDataTableRowLayout_rowWrapper:hover {
      z-index: 10 !important;
  }

  .grid-cell {
    overflow: hidden;
  }

 .grid-cell.tooltip-open {
    overflow: visible
  } 

One glitch we encounter is our tooltip closing animation being cut off when the user moves to a different row. Because of cell recycling, theres no obvious solution here.

from fixed-data-table-2.

vinayaknagpal avatar vinayaknagpal commented on July 23, 2024

Try using
https://react-bootstrap.github.io/components.html#tooltips
They position tooltips and overlays relative to body, it seems to work well with fixed-data-table

from fixed-data-table-2.

KamranAsif avatar KamranAsif commented on July 23, 2024

Closing unless theres any follow up

from fixed-data-table-2.

iamdoron avatar iamdoron commented on July 23, 2024

@KamranAsif - I tried to use your method but it seemed a little bit too much (there are a lot of edge cases, and it felt too volatile). I decided to look for solutions where the tooltip element lives outside of the table, so you don't have to 'fight' the table via css and don't carry stuff on your back 🐫.

I used https://github.com/wwayne/react-tooltip, and it works pretty well - I had to fix some issues related to the fact the table uses transforms (ReactTooltip/react-tooltip#195) - it was a minor bug. But other than that - you just put the tooltip element outside the table and it makes your life much easier.

from fixed-data-table-2.

KamranAsif avatar KamranAsif commented on July 23, 2024

Definitely the best approach. Thanks for the reply, I'm sure others will benefit!

from fixed-data-table-2.

wcjordan avatar wcjordan commented on July 23, 2024

A tooltip example using react-tooltip is now available here:
http://schrodinger.github.io/fixed-data-table-2/example-tooltip.html

from fixed-data-table-2.

currentoor avatar currentoor commented on July 23, 2024

I've been trying to use react-tooltip with this table and I'm running into some issues. I can get the react-tooltip to work with other basic react components just fine, however it fails with this table for some reason.

In the example,

class TooltipCell extends React.PureComponent {
  render() {
    const {data, rowIndex, columnKey, ...props} = this.props;
    const value = data.getObjectAt(rowIndex)[columnKey];
    return (
      <Cell
        {...props}
        onMouseEnter={() => { ReactTooltip.show(); }}
        onMouseLeave={() => { ReactTooltip.hide(); }}>
        <div ref='valueDiv' data-tip={value}>
          {value}
        </div>
      </Cell>
    );
  }
};

Why were the show/hide methods needed? Also don't they require an argument?
https://github.com/wwayne/react-tooltip/blob/master/src/decorators/staticMethods.js#L43

from fixed-data-table-2.

KamranAsif avatar KamranAsif commented on July 23, 2024

The example seems to work fine for me. You likely have a bug in your own code.
I suggest going to stackoverflow or ask for help on our discord channel

from fixed-data-table-2.

currentoor avatar currentoor commented on July 23, 2024

@KamranAsif here's a gif of your tooltip example online, not my code. I suppose it could be something specific to my browser, but I doubt it.

missing-tooltips

AFAIK if you just scroll a have a page down the table, then the rows no longer have tooltips. So rows that do not fit into the initial render, NOT a specific number of rows.

Anyway this issue went away when I called ReactTooltip.rebuild() inside onScrollEnd.

from fixed-data-table-2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.