bvaughn / react-virtualized

React components for efficiently rendering large lists and tabular data
http://bvaughn.github.io/react-virtualized/
MIT License
26.1k stars 3.05k forks source link

More than one whitespace not honored for row data #1800

Closed ahmedmmeky closed 1 year ago

ahmedmmeky commented 1 year ago

Hey I'm wondering if this is expected behavior but when we pass in row data to the Table component, if a single row element has > 1 whitespace i.e "Ahmed.....Meky" (where periods represent whitespace) the table renders "Ahmed Meky" for that element.

Here is another example:

Screen Shot 2023-02-01 at 12 24 22 PM

Is there anything we can do to ensure whitespace is detected by the table?

VitoriaTangHeng commented 1 year ago

set css style={{whiteSpace:"pre"}} can solve it

ahmedmmeky commented 1 year ago

Hey @VitoriaTangHeng thanks for responding but that didn't work. I tried other whiteSpace styles but had no luck.

Here is my attempt:

https://codesandbox.io/s/react-virtualized-table-forked-2ev0im?file=/index.js

Screen Shot 2023-02-06 at 4 23 36 PM

Whitespace is still being ignored.

VitoriaTangHeng commented 1 year ago

<Column label="Name" dataKey="name" width={200} style={{ whiteSpace: "pre" }} />

ahmedmmeky commented 1 year ago

@VitoriaTangHeng Ahh perfect this works now. Thank you very much!