[PR #1992] [MERGED] fix: validate coordinates before elementsFromPoint on Firefox mobile #3852

Closed
opened 2026-03-22 14:55:35 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-vikunja/vikunja/pull/1992
Author: @Copilot
Created: 12/16/2025
Status: Merged
Merged: 12/16/2025
Merged by: @kolaente

Base: mainHead: copilot/fix-drag-drop-error


📝 Commits (2)

  • caf62b0 Initial plan
  • 922ee9f fix: validate coordinates before calling elementsFromPoint in Firefox mobile

📊 Changes

1 file changed (+6 additions, -0 deletions)

View changed files

📝 frontend/src/composables/useTaskDragToProject.ts (+6 -0)

📄 Description

Firefox mobile drag events can provide non-finite coordinate values (undefined, NaN, Infinity) which cause document.elementsFromPoint() to throw: "Argument 1 is not a finite floating-point value."

Changes

  • Added Number.isFinite() validation in findProjectIdAtPosition() before calling elementsFromPoint()
  • Returns null when coordinates are invalid, gracefully aborting the drop operation
function findProjectIdAtPosition(mouseX: number, mouseY: number): number | null {
	// Validate coordinates are finite numbers (required by elementsFromPoint)
	if (!Number.isFinite(mouseX) || !Number.isFinite(mouseY)) {
		return null
	}

	const elementsUnderMouse = document.elementsFromPoint(mouseX, mouseY)
	// ... rest of implementation
}

The caller already handles null returns appropriately, treating it as "no valid drop target found."

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • googlechromelabs.github.io
    • Triggering command: /usr/local/bin/node node install.mjs (dns block)
  • https://storage.googleapis.com/chrome-for-testing-public/131.0.6778.204/linux64/chrome-linux64.zip
    • Triggering command: /usr/local/bin/node node install.mjs (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

in Firefox on mobile, when dragging and dropping a task on the list view, this error happens:

Document.elementsFromPoint: Argument 1 is not a finite floating-point value.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-vikunja/vikunja/pull/1992 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 12/16/2025 **Status:** ✅ Merged **Merged:** 12/16/2025 **Merged by:** [@kolaente](https://github.com/kolaente) **Base:** `main` ← **Head:** `copilot/fix-drag-drop-error` --- ### 📝 Commits (2) - [`caf62b0`](https://github.com/go-vikunja/vikunja/commit/caf62b05a6dd9827aff8f381ded7652f73daa46d) Initial plan - [`922ee9f`](https://github.com/go-vikunja/vikunja/commit/922ee9f9c62c37b2133c016252953ef1003c3cc6) fix: validate coordinates before calling elementsFromPoint in Firefox mobile ### 📊 Changes **1 file changed** (+6 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/composables/useTaskDragToProject.ts` (+6 -0) </details> ### 📄 Description Firefox mobile drag events can provide non-finite coordinate values (`undefined`, `NaN`, `Infinity`) which cause `document.elementsFromPoint()` to throw: "Argument 1 is not a finite floating-point value." **Changes** - Added `Number.isFinite()` validation in `findProjectIdAtPosition()` before calling `elementsFromPoint()` - Returns `null` when coordinates are invalid, gracefully aborting the drop operation ```typescript function findProjectIdAtPosition(mouseX: number, mouseY: number): number | null { // Validate coordinates are finite numbers (required by elementsFromPoint) if (!Number.isFinite(mouseX) || !Number.isFinite(mouseY)) { return null } const elementsUnderMouse = document.elementsFromPoint(mouseX, mouseY) // ... rest of implementation } ``` The caller already handles `null` returns appropriately, treating it as "no valid drop target found." > [!WARNING] > > <details> > <summary>Firewall rules blocked me from connecting to one or more addresses (expand for details)</summary> > > #### I tried to connect to the following addresses, but was blocked by firewall rules: > > - `googlechromelabs.github.io` > - Triggering command: `/usr/local/bin/node node install.mjs` (dns block) > - `https://storage.googleapis.com/chrome-for-testing-public/131.0.6778.204/linux64/chrome-linux64.zip` > - Triggering command: `/usr/local/bin/node node install.mjs` (http block) > > If you need me to access, download, or install something from one of these locations, you can either: > > - Configure [Actions setup steps](https://gh.io/copilot/actions-setup-steps) to set up my environment, which run before the firewall is enabled > - Add the appropriate URLs or hosts to the custom allowlist in this repository's [Copilot coding agent settings](https://github.com/go-vikunja/vikunja/settings/copilot/coding_agent) (admins only) > > </details> <!-- START COPILOT CODING AGENT SUFFIX --> <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > in Firefox on mobile, when dragging and dropping a task on the list view, this error happens: > > Document.elementsFromPoint: Argument 1 is not a finite floating-point value. </details> <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-22 14:55:35 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#3852