Skip to content

[ftr#905] Fix crash when ownerDocument is null#912

Merged
stefcameron merged 8 commits into
masterfrom
tabbable-i905
Feb 8, 2023
Merged

[ftr#905] Fix crash when ownerDocument is null#912
stefcameron merged 8 commits into
masterfrom
tabbable-i905

Conversation

@stefcameron

@stefcameron stefcameron commented Jan 25, 2023

Copy link
Copy Markdown
Member

Fixes focus-trap/focus-trap-react#905

There's a corner case where a node's ownerDocument could be null if
that node is itself the document, which could happen under special
circumstances.

PR Checklist

Please leave this checklist in your PR.

  • Source changes maintain stated browser compatibility.
  • Issue being fixed is referenced.
  • Unit test coverage added/updated.
  • E2E test coverage added/updated.
  • Typings added/updated.
  • Changes do not break SSR:
    • Careful to test typeof document/window !== 'undefined' before using it in code that gets executed on load.
  • README updated (API changes, instructions, etc.).
  • Changes to dependencies explained.
  • Changeset added (run yarn changeset locally to add one, and follow the prompts).
    • EXCEPTION: A Changeset is not required if the change does not affect any of the source files that produce the package bundle. For example, demo changes, tooling changes, test updates, or a new dev-only dependency to run tests more efficiently should not have a Changeset since it will not affect package consumers.

@changeset-bot

changeset-bot Bot commented Jan 25, 2023

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b988c11

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
tabbable Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov

codecov Bot commented Jan 25, 2023

Copy link
Copy Markdown

Codecov Report

Base: 97.83% // Head: 97.87% // Increases project coverage by +0.03% 🎉

Coverage data is based on head (26d4742) compared to base (4740139).
Patch coverage: 92.30% of modified lines in pull request are covered.

❗ Current head 26d4742 differs from pull request most recent head b988c11. Consider uploading reports for the commit b988c11 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #912      +/-   ##
==========================================
+ Coverage   97.83%   97.87%   +0.03%     
==========================================
  Files           1        1              
  Lines         231      235       +4     
  Branches      111      113       +2     
==========================================
+ Hits          226      230       +4     
  Misses          5        5              
Impacted Files Coverage Δ
src/index.js 97.87% <92.30%> (+0.03%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@stefcameron stefcameron changed the title [#905] Fix crash when ownerDocument is null [ftr#905] Fix crash when ownerDocument is null Jan 25, 2023
Fixes #905

There's a corner case where a node's `ownerDocument` could be null if
that node is itself the `document`, which could happen under special
circumstances.
@stefcameron

Copy link
Copy Markdown
Member Author

Fix confirmed, OK to merge.

@stefcameron stefcameron merged commit b8c7550 into master Feb 8, 2023
@stefcameron stefcameron deleted the tabbable-i905 branch February 8, 2023 18:22
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.

TypeError: Cannot read properties of undefined (reading 'contains')

1 participant