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

feat(AutoFocusZone): added simple AutoFocusZone component for focusing the first focusable element or the element with the provided selector #1015

Merged
merged 8 commits into from
Mar 5, 2019

Conversation

mnajdova
Copy link
Contributor

@mnajdova mnajdova commented Mar 5, 2019

Added AutoFocusZone component and popupAutoFocusBehavior.

</AutoFocusZone>
<button className={'z'}>z</button>
</div>,
) as HTMLElement
Copy link
Member

Choose a reason for hiding this comment

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

Can we use enzyme for tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was copying and trying to keep these tests consistent with the other focus zone tests.. If we decide later to move all of them to enzyme we will do it for all of them.

@codecov
Copy link

codecov bot commented Mar 5, 2019

Codecov Report

Merging #1015 into master will increase coverage by 0.06%.
The diff coverage is 93.87%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1015      +/-   ##
==========================================
+ Coverage   81.37%   81.44%   +0.06%     
==========================================
  Files         673      675       +2     
  Lines        8699     8745      +46     
  Branches     1475     1483       +8     
==========================================
+ Hits         7079     7122      +43     
- Misses       1605     1607       +2     
- Partials       15       16       +1
Impacted Files Coverage Δ
packages/react/src/lib/accessibility/index.ts 100% <100%> (ø) ⬆️
.../src/lib/accessibility/FocusZone/AutoFocusZone.tsx 100% <100%> (ø)
packages/react/src/index.ts 100% <100%> (ø) ⬆️
...ges/react/src/lib/accessibility/FocusZone/index.ts 100% <100%> (ø) ⬆️
...sibility/Behaviors/Popup/popupAutoFocusBehavior.ts 100% <100%> (ø)
packages/react/src/lib/accessibility/types.ts 100% <100%> (ø) ⬆️
...ages/react/test/specs/behaviors/testDefinitions.ts 94.57% <75%> (-0.74%) ⬇️
packages/react/src/components/Popup/Popup.tsx 75.23% <83.33%> (-0.01%) ⬇️

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 19dfbe3...2088c2d. Read the comment docs.

@codecov
Copy link

codecov bot commented Mar 5, 2019

Codecov Report

Merging #1015 into master will increase coverage by 0.06%.
The diff coverage is 94%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1015      +/-   ##
==========================================
+ Coverage   81.45%   81.51%   +0.06%     
==========================================
  Files         673      675       +2     
  Lines        8708     8755      +47     
  Branches     1549     1492      -57     
==========================================
+ Hits         7093     7137      +44     
- Misses       1600     1602       +2     
- Partials       15       16       +1
Impacted Files Coverage Δ
packages/react/src/lib/accessibility/index.ts 100% <100%> (ø) ⬆️
.../src/lib/accessibility/FocusZone/AutoFocusZone.tsx 100% <100%> (ø)
packages/react/src/index.ts 100% <100%> (ø) ⬆️
...ges/react/src/lib/accessibility/FocusZone/index.ts 100% <100%> (ø) ⬆️
...sibility/Behaviors/Popup/popupAutoFocusBehavior.ts 100% <100%> (ø)
packages/react/src/lib/accessibility/types.ts 100% <100%> (ø) ⬆️
...ages/react/test/specs/behaviors/testDefinitions.ts 94.57% <75%> (-0.74%) ⬇️
packages/react/src/components/Popup/Popup.tsx 75.23% <83.33%> (-0.01%) ⬇️

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 ebd2efc...7ce4e1a. Read the comment docs.

manajdov and others added 2 commits March 5, 2019 14:30
removed empty state object int he component definition
import callable from '../../callable'
import Ref from '../../../components/Ref/Ref'

/** AutoFocusZone is used to focus the first element inside it's children. */
Copy link
Contributor

Choose a reason for hiding this comment

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

Not only first, but als by selector
...is used to focus inner element on mount...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to: AutoFocusZone is used to focus inner element on mount. You are right, the props description will indicate the details.

as?: React.ReactType

/**
* Indicates the selector for first focusable item. Only applies if focusPreviouslyFocusedInnerElement == false.
Copy link
Contributor

Choose a reason for hiding this comment

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

No needd Only applies if focusPreviouslyFocusedInnerElement == false.

Copy link
Contributor

@sophieH29 sophieH29 left a comment

Choose a reason for hiding this comment

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

Looks very good to me

manajdov and others added 4 commits March 5, 2019 15:28
@mnajdova mnajdova merged commit 7760f24 into master Mar 5, 2019
@delete-merged-branch delete-merged-branch bot deleted the feat/auto-focus-zone branch March 5, 2019 14:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants