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

fix(FocusZone): fix last breaking changes and make improvements when using Chat #614

Merged
merged 16 commits into from
Dec 20, 2018

Conversation

sophieH29
Copy link
Contributor

@sophieH29 sophieH29 commented Dec 14, 2018

Fixes/improvements addressed to FocusZone:

  • fix after breaking changes introduced in feat(chat): chat item gutter and refactoring #556 - changed selector in chatBehavior
  • revert feat(FocusZone): Handle keyDownCapture based on client needs #563 - found a corner case when it can break functionality
  • introduced shouldResetActiveElementWhenTabFromZone prop - when TAB from FocusZone, give possibility to reset activeElement. So when TAB back to FocusZone, activeElement will be set to initial value, not where we left before. This behavior important for particular cases, for e.g., when using VirtualList we should always TAB back to last visible message
  • moved setting activeElement from defaultTabbableElement prop to updateIndexes method. Before it was in componentDidMount, which would not always work in an exact time when we expect (when using VirtualList items are rendered with delay after FocusZone's componentDidMount was called). Using it updateIndexes method will assure that activeElement was initially set, so we can update tab indexes accordingly to it.

TODO:

  • UPDATE CHANGELOG

@sophieH29 sophieH29 added 🚀 ready for review 🧰 fix Introduces fix for broken behavior. labels Dec 17, 2018
@@ -36,8 +36,11 @@ const ChatBehavior: Accessibility = (props: any) => ({
})

const getLastTabbableElement = (root: HTMLElement): HTMLElement => {
const lastVisibleMessage = root.querySelector('[data-last-visible="true"]') as HTMLElement
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This behavior will be moved in future

Copy link
Contributor

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

Update the changelog and you are good to merge!

@sophieH29 sophieH29 merged commit 9f66a14 into master Dec 20, 2018
@sophieH29 sophieH29 deleted the fix/focus-zone-fix-for-virtual-list branch December 20, 2018 12:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🧰 fix Introduces fix for broken behavior. 🚀 ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants