Skip to content

fix: real-time lat/lon validation to prevent map crash (#808)#822

Merged
wilhel1812 merged 1 commit intostagingfrom
issue/808-latitude-paste-crash-v2
May 3, 2026
Merged

fix: real-time lat/lon validation to prevent map crash (#808)#822
wilhel1812 merged 1 commit intostagingfrom
issue/808-latitude-paste-crash-v2

Conversation

@wilhel1812
Copy link
Copy Markdown
Owner

Summary

  • Add real-time latitude/longitude validation in setSitePositionDraft to prevent invalid coordinates from reaching maplibre-gl
  • Show validation errors on input fields immediately using aria-invalid and field-help pattern
  • Only update mapEditorSiteDraft when coordinates pass validation (-90..90 for lat, -180..180 for lon)
  • Fixes crash when pasting 956894 in latitude field

Fixes

Closes #808

Verification

  • npm test passes (480 tests)
  • npm run build succeeds
  • Real-time validation prevents crash by blocking invalid coordinates from map marker placement

@wilhel1812 wilhel1812 merged commit d105094 into staging May 3, 2026
5 checks passed
@wilhel1812 wilhel1812 deleted the issue/808-latitude-paste-crash-v2 branch May 3, 2026 09:15
wilhel1812 added a commit that referenced this pull request May 3, 2026
* Revert "fix: add real-time lat/lon validation to prevent map crash (#808) (#822)"

This reverts commit d105094.

* Revert "fix: validate latitude/longitude ranges to prevent crash on invalid input (#808) (#821)"

This reverts commit 19d817d.

---------

Co-authored-by: wilhel1812 <wilhelm@linksim.link>
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.

1 participant