@gemx-dev/clarity-visualize 0.8.65 → 0.8.66

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.
@@ -996,7 +996,9 @@ var HeatmapHelper = /** @class */ (function () {
996
996
  if (e.tagName === "CANVAS" /* Constant.Canvas */ || (e.id && e.id.indexOf("clarity-" /* Constant.ClarityPrefix */) === 0)) {
997
997
  continue;
998
998
  }
999
- visibility = e === el;
999
+ // Consider visible if the top element is the element itself OR a descendant of it
1000
+ // (e.g. a BUTTON containing P/SPAN children — children will appear on top in elementsFromPoint)
1001
+ visibility = e === el || el.contains(e);
1000
1002
  shadowElement = e.shadowRoot && e.shadowRoot != doc ? e.shadowRoot : null;
1001
1003
  break;
1002
1004
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gemx-dev/clarity-visualize",
3
- "version": "0.8.65",
3
+ "version": "0.8.66",
4
4
  "description": "Clarity visualize",
5
5
  "author": "Microsoft Corp.",
6
6
  "license": "MIT",
@@ -9,7 +9,7 @@
9
9
  "unpkg": "build/clarity.visualize.min.js",
10
10
  "types": "types/index.d.ts",
11
11
  "dependencies": {
12
- "@gemx-dev/clarity-decode": "^0.8.65"
12
+ "@gemx-dev/clarity-decode": "^0.8.66"
13
13
  },
14
14
  "devDependencies": {
15
15
  "@rollup/plugin-commonjs": "^24.0.0",
package/src/heatmap.ts CHANGED
@@ -366,7 +366,9 @@ export class HeatmapHelper {
366
366
  for (let e of elements) {
367
367
  // Ignore if top element ends up being the canvas element we added for heatmap visualization
368
368
  if (e.tagName === Constant.Canvas || (e.id && e.id.indexOf(Constant.ClarityPrefix) === 0)) { continue; }
369
- visibility = e === el;
369
+ // Consider visible if the top element is the element itself OR a descendant of it
370
+ // (e.g. a BUTTON containing P/SPAN children — children will appear on top in elementsFromPoint)
371
+ visibility = e === el || el.contains(e);
370
372
  shadowElement = e.shadowRoot && e.shadowRoot != doc ? e.shadowRoot : null;
371
373
  break;
372
374
  }