-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[Table] only 4 columns render on table mounted if table horizontal overflow #3779
Comments
seeing this as well. Related? |
+1 still happening with the following blueprint deps { If it helps, I recently migrated from these older versions of blueprint, I rolled back to remove this rendering error and it's fine. |
I also had rendering issues (only left 4 columns would render after a column resize) and it appears to be related to overflow/scrolling. Downgrading to @blueprintjs/table 3.5.0 appears to solve this issue (without introducing new ones/sacrificing any needed features). I did not have to downgrade any of the other packages though. |
Same problem here, downgrading to @blueprintjs/table@3.5.0 solves the problem. |
Thank you for the follow up @wcyoyo44 and @florianMo |
I solved that by forcing a const tableRef = useRef()
const onCompleteRender = useCallback(() => {
const lastColumnRegion = Regions.column(10) // Your table last column
tableRef.current.scrollToRegion(lastColumnRegion)
}, [])
<Table
{...tableProps}
ref={tableRef}
onCompleteRender={onCompleteRender}
>
{tableContent}
</Table |
I think this is possibly linked to #3757 which my colleague raised a while back. We've used the interim fix identified in that issue where we set the number of rows or columns (depending on what you are changing) as the Table key. It would be good to get to the bottom of this strange rendering behaviour though. We're seeing a similar issue as described here with a few of our usages of the blueprint Table component (but not all). After some testing using a basic create-react-app to render a Table then change the numRows or numColumns using a timeout, as above, my key findings are:
|
I am having the same problems. If the container of the table has height set e.g. { height: '100%' } or { height: 1000 } the 4 column issue happens but if it don't have a height set there is not problem. |
Chiming in to add that I get a four-row bug in addition to the four-column issue others are describing. I have not created an isolated example, but I've done a little testing to narrow it down. It appears that going from 0 rows (my initial state) to any number of rows that will be taller than the container trigger this. For example, if I add only 20 rows, which fit in the table without scrolling, all is good. If I add 50, I only get 4. All the rows show up normally as soon as I scroll. @am4zed's fix (#7) of putting an extra wrapper div (so now I'm wrapping my table in 2 divs) seems to fix the issue for me. I also notice the same behavior as @bofa. If I use a single wrapper and don't set a height (either % or px), no issue. But then I can't scroll the table... edit: The second container does not actually seem to fix the problem. I had not set a height on the container and that was why it seemed fixed. So this seems to happen reliably when my table appears inside of a container with a set height. edit 2: I have further found that this issue is only triggered when the columnWidths are updated. In my example, I first render the table and then later update the column widths. If instead I don't render the table at all until I have the final column widths, this seems to fix this issue. So it appears that updating column widths may be the culprit. |
This is related to #3774, part of a group of issues in table v3.8.x: https://github.com/palantir/blueprint/milestone/41 for now, I think the only good solution is to downgrade to table v3.7.x (it should work fine with the latest core package). sorry this has not been addressed sooner; I hope to take a closer look at this group of issues in the next few weeks. |
The Cell component doesn't have the onKeyDown or onKeyPress event handlers when i downgrade from 3.8.x to 3.5.0,3.60,3.70. |
I downgraded and it still doesn't work. |
I am also having the same issue. Adding some extra information for debugging efforts: when This is Downgrading to |
Is this targeted to be fixed in the upcoming release 4? |
My current solution.
work on
but not a good solution, I think... |
Environment
reproduce: https://codesandbox.io/s/blueprint-sandbox-4envh
Steps to reproduce
Actual behavior
Expected behavior
table columns render expected.
Possible solution
The
viewportRect.left
when table mounted isundefined
then I scroll the table, the
viewportRect.left
will set tonumber
The text was updated successfully, but these errors were encountered: