Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text colour artifacting when Grid is used within flex/grids #7959

Open
AdnanBen opened this issue May 13, 2024 · 1 comment
Open

Text colour artifacting when Grid is used within flex/grids #7959

AdnanBen opened this issue May 13, 2024 · 1 comment

Comments

@AdnanBen
Copy link

AdnanBen commented May 13, 2024

I'm submitting a ... (check one with "x")

[x] bug report => see 'Providing a Reproducible Scenario'
[] feature request => do not use Github for feature requests, see 'Customers of AG Grid'
[] support request => see 'Requesting Community Support'

Current behavior
Having coloured text within a cell and using ag grid with flexboxes/grids means the colour will be affected when any input element on the page is selected

Expected behavior
Colour in cells stay the same

Please tell us about your environment:
Windows

  • AG Grid version: X.X.X
    "ag-grid-community": "^31.3.1",
    "ag-grid-react": "^31.3.1",

  • Browser:
    Occurs in: Chrome, Edge
    Doesn't occur in: Firefox

  • Language: [all]

Plunker: https://plnkr.co/edit/m4SclAllVRUzANOg?open=index.jsx

Although the bug doesn't occur in plunker, running this code locally will produce it. Whenever the text input on the top is clicked into, the red font in the grid cells becomes less bold. I have come across this issue in all forms of flexboxes, grids, MUI grid. This is a minimum reproducible example I came up with.

I couldn't find many posts about Ag Grid being incompatible with flex/grids so was quite surprised how prevalently I've come across this. Tweaking certain elements like the number of divs, etc appears to mutate the problem (certain cells stay coloured, while others don't anymore). I've also seen this issue when having an editable top pinned row, though interestingly I have not been able to reproduce with a bottom pinned row.

I've attached a gif of the occurrence below.
Animation

Forcing CSS states (active/focus) does not trigger the issue, and dev tools show no CSS changing

I am prevented from using multiple colourful grids in a single page w/ responsive design because of this - anyone having similar issues would be good to hear

Thanks!

@AdnanBen
Copy link
Author

I've found a solution to this by applying the following CSS:

.ag-ltr .ag-cell{
filter:brightness(1) contrast(1)
}

I can only imagine this works because of some sort of separation introduced in how the browser renders these elements due to the filter. It does lessen the intensity of the text but this can be amended with other properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants