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 +5 -0
- package/package.json +1 -1
- package/src/interestfor.js +9 -6
- package/test/basic_test.html +3 -0
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
package/src/interestfor.js
CHANGED
|
@@ -227,12 +227,15 @@
|
|
|
227
227
|
if (!isPlainHint(target)) {
|
|
228
228
|
invoker.setAttribute("aria-expanded", "true");
|
|
229
229
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
.
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
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");
|