DataTables / Responsive

Responsive extension for DataTables, providing support for complex tables on all device screen sizes
Other
148 stars 86 forks source link

Bug: Responsive does not properly work with scrollY #128

Open nmiyazaki-chapleau opened 6 months ago

nmiyazaki-chapleau commented 6 months ago

Link: https://stackblitz.com/edit/vitejs-vite-kwlzyv?file=src%2Fmain.ts

To reproduce, reduce the horizontal width of the window while the page is open, enough to hid ethe office column. Then, widen the horizontal length of the window again. The row data will be misaligned with the columns.

I personally use BS5 and jQuery, but it is reproducible in the base version (which is the one I linked).

I believe this is due to either row cell data wrapping or column title wrapping.

nmiyazaki-chapleau commented 6 months ago

After more investigation, it appears to be the cell's wrapping that causes this issue. Hiding a column that has a row cell with wrapping data will cause all other columns after it to be misaligned when unhidden.

AllanJard commented 6 months ago

I'm not seeing the error I'm afraid. Maybe I've just being blind...

Without the Office column:

image

Resized to now include the office column:

image

Moreover the example with Responsive and scrolling on DataTables.net appears to work okay: https://datatables.net/extensions/responsive/examples/styling/scrolling.html .

nmiyazaki-chapleau commented 6 months ago

I forgot about the example on the website! That one doesn't work either on my end. Here's a video link: https://streamable.com/g24267

AllanJard commented 6 months ago

I just managed to get it into an odd state as well: image

I'm not immediately sure what is causing that I'm afraid. Almost certainly some kind of async issue with the resizing and the calculations being performance out of sequence.

I'll look into it as soon as I can, but I'm drowning in support at the moment, so I'm not 100% sure when that will be.

nmiyazaki-chapleau commented 6 months ago

No worries! Sync issue makes sense. Thanks for looking into it!