Skip to content

Fix: script error during column resizing on mobile with resizableColumnGuide option enabled (#4757)#4769

Open
mumberrymountain wants to merge 3 commits into
tabulator-tables:masterfrom
mumberrymountain:fix-issue-4757
Open

Fix: script error during column resizing on mobile with resizableColumnGuide option enabled (#4757)#4769
mumberrymountain wants to merge 3 commits into
tabulator-tables:masterfrom
mumberrymountain:fix-issue-4757

Conversation

@mumberrymountain
Copy link
Copy Markdown
Contributor

This PR fixes issue #4757. Cannot generate issue on jsfiddle… check sample below instead.

issue4757.zip

Whereas default mobile column resizing behavior of Tabulator is to trigger resizing event during touchmove event, the resizableColumnGuide option changes this behavior so that the event is triggered on touchend event instead.

Generally, touchend event occurs when all fingers are lifted from the display, which means that event.touches.length will be 0 and event.touches[0] will be undefined, and accessing event.touches[0].clientX will cause a script error.

So, I fixed to use e.changedTouches[0].clientX instead when the resizableColumnGuide option is enabled, to avoid script error.

Copy link
Copy Markdown
Collaborator

@azmy60 azmy60 left a comment

Choose a reason for hiding this comment

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

This is great. But what happens if getResizingClientX returns undefined? maybe it's unlikely? Regardless, I think we should handle the undefined edge case too just to be safe. Maybe log a warning or something?

@mumberrymountain
Copy link
Copy Markdown
Contributor Author

mumberrymountain commented Mar 29, 2026

@azmy60

Well, think it's unlikely, but no harm in being cautious. I just added a guard for the undefined case.

@azmy60
Copy link
Copy Markdown
Collaborator

azmy60 commented Mar 30, 2026

Thanks @mumberrymountain !

@azmy60 azmy60 added the PR Awaiting Merge The PR is awaiting merge in next release version label Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR Awaiting Merge The PR is awaiting merge in next release version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants