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

feat(FocusZone): Handle keyDownCapture based on client needs #563

Merged
merged 13 commits into from
Dec 11, 2018

Conversation

sophieH29
Copy link
Contributor

@sophieH29 sophieH29 commented Dec 5, 2018

This PR aims to extend FocusZone API, so the client can decide whether global onKeyDownCapture should be handled or the client wants to control tab indexes on his own.

The current use case for that is when using Chat with VirtualList, chat items are loaded asynchronously so FocusZone doesn't know when items are in place so it can update tab indexes in incorrect order. It's only happens when we Tab to chat. As long as tab indexes are set by client in correct order (as they are aware of the whole state and ecosystem of Virtual list), FocusZone will handle the rest (navigation with keys, and updating tabindexes while navigating)

@@ -58,6 +58,11 @@ export interface FocusZoneProps extends React.HTMLAttributes<HTMLElement | Focus
*/
shouldFocusFirstElementWhenReceivedFocus?: boolean

/**
* If global onKeyDownCapture should be handled and updating tab indexes
Copy link
Member

Choose a reason for hiding this comment

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

NIT: Missing trailing dot 😸

Copy link
Member

@layershifter layershifter left a comment

Choose a reason for hiding this comment

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

This change looks like a reasonable to me.

@layershifter
Copy link
Member

@sophieH29 We changed chatBehaviour there, I think that we need to update the main CHANGELOG.md , too.

@sophieH29 sophieH29 merged commit 9b66fd9 into master Dec 11, 2018
@sophieH29 sophieH29 deleted the feat/focus-zone-keydown-capture-based-on-prop branch December 11, 2018 14:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants