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

Enable table column resizing on touch-based devices #2435

Merged
merged 19 commits into from
Oct 16, 2024

Conversation

m-akinc
Copy link
Contributor

@m-akinc m-akinc commented Oct 10, 2024

Pull Request

🤨 Rationale

The table columns can't be interactively resized using touch-based interfaces (mobile).
Also fixes #1362

👩‍💻 Implementation

We handle dragging column dividers via the mouse events mousedown, mousemove, and mouseup. I replaced that with handling for the pointerdown, pointermove, and pointerup events. We also use setPointerCapture to force events to be handled by our divider, which allows us to remove the glass-overlay div.

🧪 Testing

  • Tested manually in local Storybook using Chrome's dev tools: works.
  • ... using Firefox dev tools: does not work. The issue is that the column dividers never appear, so they cannot be dragged.
  • Tested manually in Storybook on iPhone (Safari): works.
  • Updated unit tests

✅ Checklist

  • I have updated the project documentation to reflect my changes or determined no changes are needed.

@rajsite rajsite marked this pull request as draft October 10, 2024 20:45
@atmgrifter00
Copy link
Contributor

I'm not sure it's worth mentioning in the description, but I'll note that at least with my Firefox dev tools, the touch events did not work (they did in Chrome however as you noted). I think it's also worth a manual test on actual device browsers.

@m-akinc m-akinc marked this pull request as ready for review October 15, 2024 17:30
@m-akinc m-akinc requested a review from rajsite October 15, 2024 17:30
Copy link
Member

@rajsite rajsite left a comment

Choose a reason for hiding this comment

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

A significant number of tests are failing, please reset when PR is passing

@m-akinc m-akinc requested a review from rajsite October 15, 2024 22:47
@m-akinc
Copy link
Contributor Author

m-akinc commented Oct 16, 2024

@atmgrifter00 Can I have you take another look? I've made enough changes (primarily in the page object and tests) that I think it's warranted.

@m-akinc m-akinc requested a review from rajsite October 16, 2024 19:38
@m-akinc m-akinc enabled auto-merge (squash) October 16, 2024 22:45
@m-akinc m-akinc merged commit cb9efb3 into main Oct 16, 2024
12 checks passed
@m-akinc m-akinc deleted the users/makinc/table-column-sizing-mobile branch October 16, 2024 23:30
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.

Investigate using pointer events for column resizing.
4 participants