interestfor 1.0.6 → 1.0.7

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/README.md CHANGED
@@ -119,6 +119,11 @@ polyfill (optionally minified) or the native feature. You can run tests directly
119
119
  from this repo,
120
120
  [here](https://mfreed7.github.io/interestfor/test/test.html).
121
121
 
122
+ ## Browser Compatibility
123
+
124
+ This polyfill uses all standard APIs, and is therefore compatible with all
125
+ modern browsers, including Safari and Firefox.
126
+
122
127
  ## Improvements / Bugs
123
128
 
124
129
  If you find issues with the polyfill, feel free to file them [here](https://github.com/mfreed7/interestfor/issues).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "interestfor",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "A polyfill for the `interestfor` API",
5
5
  "keywords": "interestfor, interesttarget, polyfill, hover-triggering",
6
6
  "homepage": "https://github.com/mfreed7/interestfor#readme",
@@ -227,12 +227,15 @@
227
227
  if (!isPlainHint(target)) {
228
228
  invoker.setAttribute("aria-expanded", "true");
229
229
  }
230
- const anchorName = `--interest-anchor-${Math.random()
231
- .toString(36)
232
- .substring(2)}`;
233
- invoker.style.anchorName = anchorName;
234
- target.style.positionAnchor = anchorName;
235
- data.anchorName = anchorName;
230
+ if (getComputedStyle(invoker).anchorName === 'none' &&
231
+ getComputedStyle(target).positionAnchor === 'auto') {
232
+ const anchorName = `--interest-anchor-${Math.random()
233
+ .toString(36)
234
+ .substring(2)}`;
235
+ invoker.style.anchorName = anchorName;
236
+ target.style.positionAnchor = anchorName;
237
+ data.anchorName = anchorName;
238
+ }
236
239
  break;
237
240
  default:
238
241
  throw new Error("Invalid state");
@@ -20,4 +20,7 @@
20
20
  [popover].interest-target {
21
21
  background-color: lightblue;
22
22
  }
23
+ [popover] {
24
+ position-area: right center;
25
+ }
23
26
  </style>