Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

fix(FocusTrapZone): firstFocusableSelector is fragile #1732

Merged
merged 5 commits into from
Jul 30, 2019

Conversation

sophieH29
Copy link
Contributor

@sophieH29 sophieH29 commented Jul 29, 2019

Fixes #1566

Breaking change

Before:
firstFocusableSelector was used only to specify the class name string selector. . was appended to the passed value.

After:
firstFocusableSelector can be any string selector as is used in API for document.querySelector


This PR introduces changes to FocusTrapZone and AutoFocusZone to not limit a user to using class selectors only.
Now it's a user responsibility to pass the whole string selector whether it's a .blah or #blah or tag blah etc. If this element won't be found in the container, the first tabbable element will be selected

Sofiya Huts added 2 commits July 29, 2019 15:59
@sophieH29 sophieH29 added 🚀 ready for review 🧰 fix Introduces fix for broken behavior. accessibility All the Accessibility tasks and bugs should be tagged with this. labels Jul 29, 2019
@sophieH29 sophieH29 self-assigned this Jul 29, 2019
@codecov
Copy link

codecov bot commented Jul 29, 2019

Codecov Report

Merging #1732 into master will not change coverage.
The diff coverage is 50%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1732   +/-   ##
=======================================
  Coverage   70.98%   70.98%           
=======================================
  Files         860      860           
  Lines        7156     7156           
  Branches     2058     2078   +20     
=======================================
  Hits         5080     5080           
  Misses       2070     2070           
  Partials        6        6
Impacted Files Coverage Δ
.../src/lib/accessibility/FocusZone/FocusTrapZone.tsx 70.58% <0%> (ø) ⬆️
.../src/lib/accessibility/FocusZone/AutoFocusZone.tsx 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b70bee7...9afef92. Read the comment docs.

@layershifter
Copy link
Member

Please describe breaking changes in PR description 😼

@sophieH29 sophieH29 merged commit 6b6465d into master Jul 30, 2019
@delete-merged-branch delete-merged-branch bot deleted the fix/ftz-first-focusable-selector-is-fragile branch July 30, 2019 14:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accessibility All the Accessibility tasks and bugs should be tagged with this. 🧰 fix Introduces fix for broken behavior. 🚀 ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FocusTrapZone firstFocusableSelector prop is fragile
3 participants