Commit 03e8629
fix(Drawing/Measures): make drawing work in Safari
In Safari, clicking on the map did not add any point to the sketch and
double-clicking selected the tooltip text instead of finishing the drawing.
Three cumulative causes:
- `ol/ol.css` (which sets `user-select: none` on `.ol-viewport`) is not
guaranteed to be loaded by the host application. Without it, `mousedown`
on the map starts a text selection; Safari then fires `pointercancel` and
`ol/interaction/Draw` never receives its `pointerup`, so no point is added.
- `ol/Overlay` defaults to `class="ol-overlay-container ol-selectable"`, which
explicitly re-enables text selection on the drawing and measure tooltips.
- The `Drawing` tooltip overlays were created without `stopEvent: false`
(unlike the `Measures` ones), so they landed in `ol-overlaycontainer-stopevent`
and blocked event propagation to the map.
Fixes:
- Drawing: add `stopEvent: false` and an explicit `className` without
`ol-selectable` on both tooltip overlays (line and polygon).
- Measures: add the same explicit `className` on `measureTooltip` and
`helpTooltip`.
- GPFgeneralWidget.css: fall back to `user-select: none` and
`-webkit-touch-callout: none` on `.ol-viewport` / `.ol-unselectable`, while
restoring `user-select: text` on `.ol-selectable`, widget inputs/textareas
and `[contenteditable]` elements.
- GPFdrawing.css / GPFmeasureToolTip.css: `user-select: none` and
`pointer-events: none` on the tooltips.
Closes #573
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01832PBwBgcAdTDV2ZrhigKQ1 parent e53673d commit 03e8629
6 files changed
Lines changed: 52 additions & 0 deletions
File tree
- src/packages
- CSS
- Controls
- Drawing
- Measures
- Controls
- Drawing
- Measures
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
58 | 63 | | |
59 | 64 | | |
60 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
10 | 15 | | |
11 | 16 | | |
12 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
587 | 587 | | |
588 | 588 | | |
589 | 589 | | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1827 | 1827 | | |
1828 | 1828 | | |
1829 | 1829 | | |
| 1830 | + | |
| 1831 | + | |
1830 | 1832 | | |
1831 | 1833 | | |
1832 | 1834 | | |
| |||
1877 | 1879 | | |
1878 | 1880 | | |
1879 | 1881 | | |
| 1882 | + | |
| 1883 | + | |
1880 | 1884 | | |
1881 | 1885 | | |
1882 | 1886 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
| 353 | + | |
353 | 354 | | |
354 | 355 | | |
355 | 356 | | |
| |||
374 | 375 | | |
375 | 376 | | |
376 | 377 | | |
| 378 | + | |
377 | 379 | | |
378 | 380 | | |
379 | 381 | | |
| |||
0 commit comments