Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: avoid focusing already removed iframe(closes #2178) #2750

Merged
merged 1 commit into from Mar 28, 2022
Merged

fix: avoid focusing already removed iframe(closes #2178) #2750

merged 1 commit into from Mar 28, 2022

Conversation

Artem-Babich
Copy link
Contributor

Purpose

In some cases, a focus event can be raised for the element in the iframe at the moment when the iframe is removed from the document. For example in React application:
If you call the parent.postMessage from the iframe page and update the parent component state to remove the iframe element, the reference to the element in the "iframe" will be alive at the time when the "iframe" is fully removed from the page. React internal mechanism tries to focus this element. HammerHead's internal mechanism catches this focus event and tries to focus a non-existent element, which results in an error.

Approach

Check the "defaultView" value before making any manipulation in the focus method.

References

Error: "TypeError: window.location.toString is not a function"

@AndreyBelym AndreyBelym reopened this Mar 25, 2022
@AndreyBelym AndreyBelym temporarily deployed to authentication March 25, 2022 17:57 Inactive
@AndreyBelym AndreyBelym temporarily deployed to CI March 25, 2022 17:58 Inactive
@AndreyBelym AndreyBelym changed the title Fix "TypeError: window.location.toString is not a function"(closes #2178) fi:x: avoid focusing already removed iframe(closes #2178) Mar 28, 2022
@AndreyBelym AndreyBelym changed the title fi:x: avoid focusing already removed iframe(closes #2178) fix: avoid focusing already removed iframe(closes #2178) Mar 28, 2022
@Artem-Babich Artem-Babich merged commit 4a9cd8f into DevExpress:master Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants