material-ui-datatables icon indicating copy to clipboard operation
material-ui-datatables copied to clipboard

Tooltip overflowing container

Open mrwillis opened this issue 8 years ago • 2 comments

Hi all,

Not sure if this is fixable within this lib due to limitations with pre-v1 MUI, but basically I am having this issue where the tooltip is getting cut-off by the end of its parent container. It only occurs with the final column nearest to the right of the container. So essentially this

image

Here is my <DataTable> component

<DataTable columns={columns}
        onSortOrderChange={this.props.onBidBuySortChange}
        showCheckboxes={false}
        height={'auto'} showRowHover selectable={false}
        data={this.props.view === 'Orders' ? this.props.topOrdersBidDataPruned : this.props.topTradesBuyDataPruned}
        showFooterToolbar={false} tableRowColumnStyle={tableTextStyle}
        tableHeaderColumnStyle={{
          wordWrap: 'break-word',
          whiteSpace: 'normal',
          overflow: 'visible'
        }}
        initialSort={this.props.initialBidBuySort} />

And the relevant entry for the column:

        {
          key: 'spreadToBestMeQuote',
          label: 'Avg. Spread to My Best Quote',
          sortable: true,
          tooltip: 'Average spread to the best bid/offer of this broker',
          render: (spread) => {
            if (numeral(spread).value() < 0) {
              return (<p style={{color: colors.red}}>{spread}</p>)
            } else {
              return (<p>{spread}</p>)
            }
          }
        }

Is there any workaround/hack I can use to get this to work?

Thanks

mrwillis avatar Sep 25 '17 14:09 mrwillis

@mrwillis Hi, I think what we can do now is to increase width which doesn't solve the problem fundamentally. 😅 I'm considering adding a prop which can change a position of a tooltip like it on Icon Button.

hyojin avatar Sep 27 '17 00:09 hyojin

I'd be interested in having an ability to resize the tooltip as well. I'm trying to customize a table to have its various fonts and spacings resize dynamically with the width of the page, and the inability to shrink the arrow along with the page ends up increasing the height of the table header. (Though I could be mistaken.)

americool avatar Nov 08 '17 16:11 americool