material-table icon indicating copy to clipboard operation
material-table copied to clipboard

Is it possible to make the new row that is generated by onRowAdd material table to appear at the top of the section?

Open v1v2v3vv55 opened this issue 5 years ago • 3 comments

Title.

As what is shown in the doc of material table, when you use editable with onRowAdd, the new row is always spawn at the bottom of the section. Is there a way to make that row appear at the top? Or how do I assign an onClick effect so that when user click on the Add button, it will automatically go to the bottom of the page? Let's just use the example on the doc: https://material-table.com/#/docs/features/editable

v1v2v3vv55 avatar Feb 12 '21 17:02 v1v2v3vv55

Just found out how to do this, in the options prop for the table, add the attribute addRowPosition: 'first' Screen Shot 2021-02-14 at 12 09 49 PM

I was a little frustrated by this. I think that should probably be the default setting. The documentation for this is also very challenging to find.

Hopefully that works for you

rphovley avatar Feb 14 '21 19:02 rphovley

@rphovley unfortunately, this only resolves the issue if the user happens to be at the top of the table. If they've scrolled down the page, then they don't see the new row added. Unless there's some other solution to scroll to the new row, I think this is a usability bug (as opposed to a question).

ghost avatar Mar 28 '21 19:03 ghost

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You can reopen it if it required.

stale[bot] avatar Jun 26 '21 20:06 stale[bot]