Material-table: Issue with custom column rendering

Created on 21 May 2019  路  2Comments  路  Source: mbrn/material-table

Issue with custom column rendering - cutting off popover being displayed

Steps to reproduce

  1. Create a column with custom component that includes a popover or menu that can be opened when you click on the cell.
  2. Make sure you try this further down the grid to reproduce.
  3. Can see popover/menu getting cut off
    image

Expected behavior
image

Occurs on:
Desktop
Mobile devices

help wanted

Most helpful comment

Hi @will-code-for-cash ,

I got similar issue for custom rendering. I solved problem with use a component instead of inline render function.

Do not use like this if you have a popover:
render: rowData => <...>

Use like this:
render: MyComponent

You can access this.props.rowData in MyComponent

All 2 comments

Hi @will-code-for-cash ,

I got similar issue for custom rendering. I solved problem with use a component instead of inline render function.

Do not use like this if you have a popover:
render: rowData => <...>

Use like this:
render: MyComponent

You can access this.props.rowData in MyComponent

Hi,

Sorry to open a closed issue, however I have a question that is basically exactly the same issue as this one.
Feeding the render option a component is no longer a valid option so it this issue has come back.
The render option either just thinks it's a function (when using reacts functional components), or it does not render at all throwing an error (when using a class): this.props.columnDef.render is not a function.

I am using it with a split button (https://material-ui.com/components/button-group/#split-button) like below:
Screenshot 2020-08-31 at 16 15 18

But it renders badly like the example in the first post:
Screenshot 2020-08-31 at 16 15 22

Was this page helpful?
0 / 5 - 0 ratings