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

Grid: Fix resizing in Firefox #454

Merged
merged 5 commits into from
Jul 29, 2024
Merged

Conversation

hoorayimhelping
Copy link
Collaborator

@hoorayimhelping hoorayimhelping commented Jul 26, 2024

Helps with: https://github.com/ClickHouse/control-plane/issues/9726
Helps with: #422

See: #455

There were several issues with the Grid in Firefox. This PR addresses three of them:

  • Grid resizing just didn't happen in Firefox
  • When attempting to resize, the drag handle woudl fly to the right and blow up the horizontal scrollbar
  • After fixing the above issues, the drag handle on Firefox was in a different location than Chrome

The fixes:

  • There was a conditional check that didn't run when a value that could be 0 in Firefox came back as falsy, thus Firefox would never actually save the new column position. The fix was allowing 0 values in the if statement.
  • Firefox calculated the size of the resize header based on event.scrollWidth. For some reason, in Firefox, this width was being calculated based on the previous width. This led to an exponential growth in Firefox when increasing the size of a header - the previous width would be used in the new width calculation, which would then be used in the next width calculation, which caused the right scroll bar to expand very quickly. This was fixed by calculating the width based on event.clientWidth, rather than scrollWidth.
  • Firefox was not properly applying the :active pseudo class, so the width calculation was incorrect. This was fixed by keeping track of the active state in React based on mouse presses and releases, and passing that value into styledComponents

There was also an a11y fix for Scrollable region must have keyboard access

New behavior in Firefox

Screen.Recording.2024-07-26.at.11.30.12.AM.mov

New behavior in Chrome

Screen.Recording.2024-07-26.at.11.30.50.AM.mov

Copy link

vercel bot commented Jul 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
click-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 26, 2024 3:41pm

@hoorayimhelping hoorayimhelping merged commit 7c852bb into main Jul 29, 2024
6 checks passed
@hoorayimhelping hoorayimhelping deleted the bucky-fix-grid-in-firefox branch July 29, 2024 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants