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

Fixes bug with whitespace on DataTable when merge_duplicate_header=True #2939

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

leeagustin
Copy link
Contributor

Fixes #2870.

Before:
DataTable_before_1
DataTable_before_2

After:
DataTable_after

I'm not sure how the DataTable class works exactly, but by inspecting the DOM, I was able to pinpoint that the issue is with the following:
DataTable_issue

I think what's happening is the following: inside the table dash-fixed-column, the non-header columns are being resized to the same widths as the header columns from the dash-fixed-content table. Since there are more non-header columns than header ones, the non-header columns overflow to the right. Hence, the solution would be to resize the non-header columns to the width of the non-header columns from dash-fixed-content (and not the header columns).

Before adding or modifying a test, I wanted to check if this makes sense.

Contributor Checklist

  • I have broken down my PR scope into the following TODO tasks
    • Fixes bug with whitespace on DataTable when merge_duplicate_header=True
  • I have run the tests locally and they passed. (refer to testing section in contributing)
  • I have added tests, or extended existing tests, to cover any new features or bugs fixed in this PR

optionals

  • I have added entry in the CHANGELOG.md
  • If this PR needs a follow-up in dash docs, community thread, I have mentioned the relevant URLS as follows
    • this GitHub #PR number updates the dash docs
    • here is the show and tell thread in Plotly Dash community

@gvwilson gvwilson added feature something new P2 needed for current cycle fix fixes something broken community community contribution and removed feature something new labels Aug 13, 2024
@T4rk1n
Copy link
Contributor

T4rk1n commented Sep 3, 2024

Before adding or modifying a test, I wanted to check if this makes sense.

The bugfix makes sense, screenshot show the desired behavior. Just missing a changelog entry and a test if possible.

@gvwilson
Copy link
Contributor

gvwilson commented Sep 3, 2024

@leeagustin thanks for the fix - we're happy to merge if you can provide a changelog entry (a test would also be nice)

Copy link
Contributor

@gvwilson gvwilson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved pending changelog entry and/or test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community community contribution fix fixes something broken P2 needed for current cycle
Projects
None yet
Development

Successfully merging this pull request may close these issues.

whitespace on DataTable when merge_duplicate_headers= True
4 participants