fix: add polling and reset handling for single mode coordinates
Enhanced coordinate synchronization in single mode to handle Panel actions like "Supprimer" (reset to saved values). Issues Fixed: - Marker not updating when clicking "Supprimer" button in Panel - Panel "Supprimer" restores saved coordinates but marker didn't move - No detection of programmatic field value changes Solution: - Add MutationObserver to detect attribute changes on input fields - Add 500ms polling as fallback for value detection - Add nextTick() for reactive updates to ensure proper timing - Handle coordinate reset: when invalid, return to default center - Proper cleanup with onBeforeUnmount for observers and intervals Behavior: - User changes field → marker updates immediately - User drags marker → fields update immediately - User clicks "Supprimer" → marker returns to saved position - Fields cleared → marker disappears, map resets to default center Technical Details: - MutationObserver watches 'value' attribute on lat/lon inputs - Polling checks every 500ms for changes missed by events - Watcher uses nextTick() to ensure DOM updates complete - All event listeners and observers properly cleaned up on unmount Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
cc44a68e66
commit
818506fcfa
2 changed files with 88 additions and 40 deletions
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue