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

DataTable: Frozen columns have transparent background on the Arya theme #3700

Closed
rschyboll opened this issue Nov 24, 2022 · 6 comments
Closed

Comments

@rschyboll
Copy link
Contributor

Describe the bug

The DataTable component, has an incorrect style on the Arya theme, when using it with frozen columns and selectable rows.
When freezing a column, and scrolling the datatable, so that some column is under the frozen one, the background of the frozen column will become partially transparent on selection or mouse hover, showing the data of the column under it.

It also seems, that the outline is also broken, if it's neccesary i can create a new issue, but this seems to be related, so i'm currently putting it only here.

Reproducer

https://codesandbox.io/s/silly-minsky-0oe4go?file=/src/demo/DataTableScrollDemo.js

PrimeReact version

8.7.2

React version

18.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

Chrome 107

Steps to reproduce the behavior

  1. Create a scrollable datatable with selectable rows and frozen columns
  2. Scroll the datatable so that some column are under the frozen ones
  3. Select a row or hover over it
  4. The data of the column under the frozen one will be visible

Expected behavior

The frozen column should not be transparent, when selected or hovered.

I fixed it by setting the the background color myself, with the following selector:

.p-highlight.p-selectable-row {
  .p-frozen-column {
    background-color: var(--table-row-select-color);
  }
}
@rschyboll rschyboll added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 24, 2022
@melloware melloware added Component: Theme Issue or pull request is related to Theme Resolution: Workaround Issue or pull request contains a workaround. It needs to be reviewed further by Core Team and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Nov 24, 2022
@melloware melloware added this to the 8.7.3 milestone Nov 24, 2022
@melloware
Copy link
Member

Actually I think this is the more accurate selector? You only want this when you frozen is highlighted.

.p-datatable .p-datatable-tbody > tr.p-highlight > td.p-frozen-column {
  background-color: var(--table-row-select-color);
}

@mertsincan mertsincan modified the milestones: 8.7.3, 8.7.4 Dec 5, 2022
@Dav3rs
Copy link

Dav3rs commented Dec 13, 2022

These workarounds doesn't work for stripedRows. One row will be transparent, and the next one will not.

image

@Dav3rs
Copy link

Dav3rs commented Dec 13, 2022

Also maybe related to this... I have a use case in what my table looses the gridLines with frozen columns
image

Looking into this issue I found that for dark theme, with stripedRows enabled to cause the bug, the gridlines are behind the frozen columns, completely imperceptible for light theme
image

@Dav3rs
Copy link

Dav3rs commented Dec 13, 2022

This happens because I'm applying the workaround for #3091 (Datatable: scrollable property loses column alignment)
Disabling it this will be my table
image

Primereact and primevue tables layout need a refactor. Don't know about primeng but I think that @cagataycivici was doing refactors there too.
image
https://twitter.com/cagataycivici/status/1581004789277917185?s=20&t=BMfkYOt5iSw2XPGwWT3XVQ

@mertsincan mertsincan modified the milestones: 8.7.4, 10.0.0 Jan 26, 2023
@mertsincan mertsincan removed Resolution: Workaround Issue or pull request contains a workaround. It needs to be reviewed further by Core Team Component: Theme Issue or pull request is related to Theme labels Feb 22, 2023
@mertsincan mertsincan removed this from the 10.0.0 milestone Feb 22, 2023
@mertsincan mertsincan removed their assignment Feb 22, 2023
@mertsincan
Copy link
Member

Hi,

I think this issue has already been fixed in 9.2.0. Please try it.
https://primereact.org/datatable/#frozen_columns

Best Regards,

@melloware melloware added this to the 9.2.0 milestone Feb 22, 2023
@melloware
Copy link
Member

Confirmed its fixed in 9.2.0

@mertsincan mertsincan removed this from the 9.2.0 milestone Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants