Skip to content

Conversation

bx80
Copy link
Contributor

@bx80 bx80 commented Jul 7, 2023

Description:

Fixes #20894

This can take a bit of time to recreate, I used the event report and clicked repeatedly on the first label to expand and collapse it:
image

Eventually the label disappears:
image

The label is disappearing because the column width is being set to zero by the resizeDataTable() event, a minimum label size is passed to getLabelWidth() but this method sometimes incorrectly calculates a zero width value from existing DOM elements. I suspect that this could be race condition between the row collapse and resize table events.

This PR adds a check to the getLabelWidth() method to prevent zero values being returned and instead falls back to the passed minLabelWidth value. After this change I was no longer able to recreate the issue, despite much clicking.

Review

…ble event collides with the row collapse event
@bx80 bx80 added Bug For errors / faults / flaws / inconsistencies etc. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Jul 7, 2023
@bx80 bx80 added this to the 5.0.0 milestone Jul 7, 2023
@bx80 bx80 requested review from michalkleiner and sgiehl July 7, 2023 06:10
@bx80 bx80 self-assigned this Jul 7, 2023
Copy link
Member

@sgiehl sgiehl left a comment

Choose a reason for hiding this comment

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

@bx80 For me this is reproducible on 5.x-dev if you click on a row to load it's subtable, but close the row before the subtable is loaded. As soon as the subtable is then loaded, the label disappears.

Co-authored-by: Stefan Giehl <stefan@matomo.org>
@bx80 bx80 requested a review from sgiehl July 10, 2023 00:02
Copy link
Member

@sgiehl sgiehl left a comment

Choose a reason for hiding this comment

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

works as expected now 👍

@sgiehl sgiehl merged commit 774a025 into 5.x-dev Jul 10, 2023
@sgiehl sgiehl deleted the m20894-row-labels-disappear branch July 10, 2023 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Development

Successfully merging this pull request may close these issues.

Row labels disappear on double click in table report
2 participants