Skip to content

Commit

Permalink
fix: correct crossframe behavior for Safary, fixes theKashey#249
Browse files Browse the repository at this point in the history
  • Loading branch information
theKashey committed Jul 9, 2023
1 parent 58e2b3f commit e1e2cdf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## [2.9.4](https://github.com/theKashey/react-focus-lock/compare/v2.9.3...v2.9.4) (2023-02-16)


### Bug Fixes

* update focus-lock to prevent error when accessing cross-origin frames. fixes [#241](https://github.com/theKashey/react-focus-lock/issues/241) ([6633d2b](https://github.com/theKashey/react-focus-lock/commit/6633d2bed7f61fe1b6ca9a573331568bbd0b63af))



## [2.9.3](https://github.com/theKashey/react-focus-lock/compare/v2.9.2...v2.9.3) (2023-01-28)


Expand Down
4 changes: 2 additions & 2 deletions src/Trap.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ FocusTrap.propTypes = {
const onWindowBlur = () => {
focusWasOutsideWindow = 'just';
// using setTimeout to set this variable after React/sidecar reaction
setTimeout(() => {
deferAction(() => {
focusWasOutsideWindow = 'meanwhile';
}, 0);
});
};

const attachHandler = () => {
Expand Down
8 changes: 1 addition & 7 deletions src/util.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
export function deferAction(action) {
// Hidding setImmediate from Webpack to avoid inserting polyfill
const { setImmediate } = window;
if (typeof setImmediate !== 'undefined') {
setImmediate(action);
} else {
setTimeout(action, 1);
}
setTimeout(action, 1);
}

export const inlineProp = (name, value) => {
Expand Down

0 comments on commit e1e2cdf

Please sign in to comment.