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

Table: Issue in column Resizing when there is action manager in columns #2032

Open
Charan-ts opened this issue May 7, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@Charan-ts
Copy link

Charan-ts commented May 7, 2024

Describe the bug (current behavior)

The Table component, along with its columns and action manager, encounters an issue with column toggling. When a column is resized and then all columns are deselected, followed by selecting all columns in the action manager, the column fails to appear in the UI.

Video of issue:
https://github.com/iTwin/iTwinUI/assets/91957106/70b8abb6-1463-4db3-8829-3c92ed3df220

Expected Behavior

The action manager should correctly display the selected columns in the UI after they have been deselected

Link to minimal repro

https://codesandbox.io/p/sandbox/table-column-resizing-xwt7g5?file=%2Fsrc%2FApp.tsx%3A11%2C27

Steps To Reproduce

  1. Create several columns within the action manager.
  2. Before deselecting all the columns in the action manager, resize any of the columns.
  3. Then proceed to deselect all the columns in the action manager.
  4. Finally, select all the columns again within the action manager.
@Charan-ts Charan-ts added the bug Something isn't working label May 7, 2024
@Ben-Pusey-Bentley
Copy link
Contributor

Hello, thanks for filing this issue. I am able to reproduce this issue with the sandbox that you have linked. I did want to add that the reason that the columns are failing to appear in the UI is because the index column is becoming wider with each removed column, eventually filing up the entire table. It can be resized afterwards to make the columns appear again. Video:

Recording.2024-05-07.154105.mp4

@mayank99 I know that you worked on Table column resizing recently. Any ideas on workarounds for this issue?

Also wanted to clarify that even though the provided sandbox is using version 2, I have confirmed that the issue persists in version 3. Sandbox link: https://codesandbox.io/p/sandbox/table-column-resizing-forked-hpkwqc

@mayank99
Copy link
Contributor

mayank99 commented May 8, 2024

@mayank99 I know that you worked on Table column resizing recently. Any ideas on workarounds for this issue?

I didn't work on the resizing logic itself, but one workaround might be to set a maxWidth to prevent the column from becoming too wide.

In any case, we should investigate this issue and find a proper fix.

It's also possible that the Table's resizing logic is faulty at its core, since we keep finding so many issues with it:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants