This repository was archived by the owner on Mar 4, 2020. It is now read-only.
feat(FocusZone): Add embed mode for FocusZone and new Chat behavior#233
Merged
feat(FocusZone): Add embed mode for FocusZone and new Chat behavior#233
Conversation
sophieH29
reviewed
Sep 18, 2018
sophieH29
reviewed
Sep 18, 2018
sophieH29
reviewed
Sep 18, 2018
sophieH29
reviewed
Sep 18, 2018
sophieH29
reviewed
Sep 18, 2018
| }, | ||
| keyActions: { | ||
| root: { | ||
| focus: { |
Member
There was a problem hiding this comment.
Is this ever used as a focus action? Or is it more something like regainFocus?
Contributor
Author
There was a problem hiding this comment.
It is used when you want to unfocus a message and focus the whole list again, so Juraj and I think that focus is an appropriate action name as the only thing it does is it literally focuses the chat. :)
sophieH29
reviewed
Sep 19, 2018
Codecov Report
@@ Coverage Diff @@
## master #233 +/- ##
==========================================
- Coverage 91.8% 91.67% -0.13%
==========================================
Files 63 63
Lines 1171 1189 +18
Branches 173 153 -20
==========================================
+ Hits 1075 1090 +15
- Misses 92 95 +3
Partials 4 4
Continue to review full report at Codecov.
|
…embed # Conflicts: # src/components/Chat/ChatMessage.tsx # test/specs/components/Chat/ChatMessage-test.tsx
miroslavstastny
approved these changes
Sep 26, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add embed mode for FocusZone and new Chat behavior
Hi, this PR does the following:
renderComponentandUIComponent:FocusZoneMode.Embed, in which case FocusZone is not wrapping the component in an additional<div>, but instead uses the component directly inrender. This is necessary for some components (e.g.,ChatMessage) not to break generic styling etc.protectedthis.focusZonereference toUIComponentavailable in components, so they can e.g., callthis.focusZone.focus().FocusZonedirectly:onFocusNotificationwith a regularonFocusevent callback to pass unit tests with embed.ref={this.setRef}withthis.setRef(this)incomponentDidMountto support functional components, which is needed to pass unit tests with embed.defaultActiveElementto query only descendants of the focus zone instead of the whole document, which enables to write simpler selectors. Note that we do not lose any functionality by this, because selecting elements outside of focus zone had no effect.isConformantandhandlesAccessibilitynow support embedded FocusZone.ChatandChatMessage:focusforChat, andpreventDefaultforChatMessage.Chat, embedded FocusZone forChatMessage.<a>links toChatexample in docsite so that we can easily test navigation there.