webmarker-js 0.4.0 → 0.6.0

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.
package/src/index.ts CHANGED
@@ -91,7 +91,7 @@ let cleanupFns: (() => void)[] = [];
91
91
  function mark(options: MarkOptions = {}): Record<string, MarkedElement> {
92
92
  try {
93
93
  const {
94
- selector = "button, input, a, select, textarea",
94
+ selector = 'a[href], button, input:not([type="hidden"]), select, textarea, summary, [role="button"], [tabindex]:not([tabindex="-1"])',
95
95
  getLabel = (_, index) => index.toString(),
96
96
  markAttribute = "data-mark-label",
97
97
  markPlacement = "top-start",
@@ -203,7 +203,7 @@ function createBoundingBox(
203
203
  const { width, height } = element.getBoundingClientRect();
204
204
  Object.assign(boundingBoxElement.style, {
205
205
  left: `${x}px`,
206
- top: `${y}px`,
206
+ top: `${y + height}px`,
207
207
  width: `${width}px`,
208
208
  height: `${height}px`,
209
209
  });