svelteplot 0.4.2-pr-186.1 → 0.4.2-pr-186.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -59,7 +59,12 @@ export function addEventHandlers(node, { options, datum, getPlotState }) {
59
59
  const { scales, body, options } = getPlotState();
60
60
  if (origEvent instanceof MouseEvent || origEvent instanceof PointerEvent) {
61
61
  let facetEl = origEvent.target;
62
- while (facetEl && !facetEl.classList.contains('facet')) {
62
+ while (facetEl &&
63
+ !facetEl.classList.contains('facet') &&
64
+ facetEl.parentElement) {
65
+ // ensure that parentElement is SVGElement
66
+ if (!(facetEl.parentElement instanceof SVGElement))
67
+ break;
63
68
  facetEl = facetEl.parentElement;
64
69
  }
65
70
  const facetRect = (facetEl?.firstChild ?? body).getBoundingClientRect();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelteplot",
3
- "version": "0.4.2-pr-186.1",
3
+ "version": "0.4.2-pr-186.2",
4
4
  "license": "ISC",
5
5
  "author": {
6
6
  "name": "Gregor Aisch",