mui-datatables icon indicating copy to clipboard operation
mui-datatables copied to clipboard

Title duplicated on the extreme left

Open giovanisleite opened this issue 8 years ago • 5 comments

The table title appears duplicated because of this two pieces of code(here and here):

 caption: {
    position: "absolute",
    left: "-1000px",
},
<caption className={classes.caption}>{title}</caption>

Expected Behavior

This second appearance of the title shouldn't happen

Current Behavior

I suggest the removal caption-title piece and I would be happy to do it, but before I want to understand why it is there (maybe there is a reason and needs a more complex solution).

Steps to Reproduce (for bugs)

  1. Just zoom-out the table

Your Environment

Tech Version
Material-UI 3.1.4
MUI-datatables 2.0.0-beta-36
React 16.4.1
browser chrome & firefox

giovanisleite avatar Oct 25 '18 13:10 giovanisleite

It is there for accessibility purposes so when a screen reader goes over the table it has a caption to read. I think a compromise to this is to set the position even further. I'm going to move it to -3000

gregnb avatar Oct 28 '18 23:10 gregnb

Thanks, @gregnb

giovanisleite avatar Oct 29 '18 04:10 giovanisleite

this cause issue has an issue in Firefox scroll

Screenshot 2021-12-06 at 20 50 12

yaminyaylo avatar Dec 06 '21 18:12 yaminyaylo

A good approach to solve this can be the strategy used by @joshwcomeau on this snippet (https://www.joshwcomeau.com/snippets/react-components/visually-hidden/)

giovanisleite avatar Dec 06 '21 19:12 giovanisleite

snippet (https://www.joshwcomeau.com/snippets/react-components/visually-hidden/)

thanks a lot @giovanisleite, in my case, I've just fixed it by adding top: 0 for MUIDataTable override file.

Screenshot 2021-12-06 at 21 09 22

and now it looks fine Screenshot 2021-12-06 at 21 12 05

yaminyaylo avatar Dec 06 '21 19:12 yaminyaylo