Skip to content

Instantly share code, notes, and snippets.

View PitWenkin's full-sized avatar
🤓
Reporting issues in other persons projects…

Pit Wenkin PitWenkin

🤓
Reporting issues in other persons projects…
View GitHub Profile
@NickGard
NickGard / safari-focus-polyfill.v2.js
Last active July 23, 2024 06:42
Updated polyfill for fixing click focusability in Safari. Handles shadow DOM clicks now.
(function () {
const capturedEvents = [];
let capturing = false;
let captureTarget = null;
let deferredDispatch;
const faultyElementSelector = [
"a[href]",
"area[href]",
"audio[controls]",
@NickGard
NickGard / safari-focus-polyfill.js
Last active January 29, 2024 10:24
Safari Focus Polyfill
(function() {
var capturedEvents = [];
var capturing = false;
function getEventTarget(event) {
return event.composedPath()[0] || event.target;
}
function captureEvent(e) {
if (capturing) {