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

[BREAKING][#666] Default full to attached nodes only; add legacy-full #764

Merged
merged 1 commit into from
Aug 12, 2022

Conversation

stefcameron
Copy link
Member

Fixes #666

Tabbable has long had legacy behavior that treated detached nodes as
visible. This commit makes the default/full displayCheck option
now behave correctly in that it treates detached nodes as hidden.

But since many people may depend on the buggy legacy behavior, a
new 'legacy-full' option is added which preserves the legacy
behavior, for now.

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
Copy link

changeset-bot bot commented Aug 10, 2022

🦋 Changeset detected

Latest commit: 5ff50fd

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

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

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

Fixes #666

Tabbable has long had legacy behavior that treated detached nodes as
visible. This commit makes the default/full `displayCheck` option
now behave correctly in that it treates detached nodes as hidden.

But since many people may depend on the buggy legacy behavior, a
new 'legacy-full' option is added which preserves the legacy
behavior, for now.
@codecov
Copy link

codecov bot commented Aug 10, 2022

Codecov Report

Merging #764 (5ff50fd) into master (5f40c8e) will increase coverage by 0.10%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #764      +/-   ##
==========================================
+ Coverage   97.72%   97.83%   +0.10%     
==========================================
  Files           1        1              
  Lines         220      231      +11     
  Branches      106      111       +5     
==========================================
+ Hits          215      226      +11     
  Misses          5        5              
Impacted Files Coverage Δ
src/index.js 97.83% <100.00%> (+0.10%) ⬆️

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

@stefcameron
Copy link
Member Author

@craigkovatch @idoros I'm fixing #666 which we had logged a while back after this happened: #664

I'm going to publish a major because I'm dropping all IE support now that IE has been sunset for good, so this is the opportunity to fix the default "full" display check behavior.

I've added a legacy-full option that still does the old behavior which folks can use if they need an escape valve for this new major. But going forward, the intention is to eventually drop the legacy behavior completely.

Sounds/looks good?

@craigkovatch
Copy link

craigkovatch commented Aug 10, 2022 via email

@stefcameron
Copy link
Member Author

Thanks for checking it, both of you! Merging.

@stefcameron stefcameron merged commit a09ba0b into master Aug 12, 2022
@stefcameron stefcameron deleted the detached-nodes branch August 12, 2022 19:24
@@ -135,7 +135,7 @@ These options apply to all APIs.

### displayCheck option

Type: `full` | `non-zero-area` | `none` . Default: `full`.
Type: `full` | `full-with-hidden` | `non-zero-area` | `none` . Default: `full`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the new name was legacy-full?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's legacy-full. Thanks for catching that. Will fix it right away.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 1d15204

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.

[MAJOR] isHidden should exclude detached nodes by default
2 participants