This repository was archived by the owner on Mar 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 53
fix(FocusZone): fix last breaking changes and make improvements when using Chat #614
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
bca486d
fix(FocusZone): fix last breaking changes and make improvements when …
70da299
Merge branch 'master' into fix/focus-zone-fix-for-virtual-list
sophieH29 3c9c9a4
set explicit query selector on boolean attributes
4a948ae
fix propTypes
585bd0c
set explicit query selector on boolean attributes
dcb4839
Small fix of console error
58bd53b
Merge branch 'master' into fix/focus-zone-fix-for-virtual-list
sophieH29 f80b3b5
Merge branch 'master' into fix/focus-zone-fix-for-virtual-list
sophieH29 0c07049
Merge branch 'master' into fix/focus-zone-fix-for-virtual-list
sophieH29 1ac3053
Merge branch 'master' into fix/focus-zone-fix-for-virtual-list
sophieH29 cbfe8d1
Merge branch 'master' into fix/focus-zone-fix-for-virtual-list
sophieH29 19ec4f2
Merge branch 'master' into fix/focus-zone-fix-for-virtual-list
sophieH29 d1e349c
Merge branch 'master' into fix/focus-zone-fix-for-virtual-list
sophieH29 dcf7892
Merge branch 'master' into fix/focus-zone-fix-for-virtual-list
sophieH29 4e97e13
update changelog
6f1b16f
update changelog
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ const ChatBehavior: Accessibility = (props: any) => ({ | |
props: { | ||
shouldEnterInnerZone: event => keyboardKey.getCode(event) === keyboardKey.Enter, | ||
direction: FocusZoneDirection.vertical, | ||
shouldHandleKeyDownCapture: false, | ||
shouldResetActiveElementWhenTabFromZone: true, | ||
defaultTabbableElement: getLastTabbableElement, // select last chat message by default | ||
[CHAT_FOCUSZONE_ATTRIBUTE]: '', // allows querying the default active element | ||
}, | ||
|
@@ -36,8 +36,11 @@ const ChatBehavior: Accessibility = (props: any) => ({ | |
}) | ||
|
||
const getLastTabbableElement = (root: HTMLElement): HTMLElement => { | ||
const lastVisibleMessage = root.querySelector('[data-last-visible="true"]') as HTMLElement | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This behavior will be moved in future |
||
if (lastVisibleMessage) return lastVisibleMessage | ||
|
||
const chatItemsElements = root.querySelectorAll( | ||
`[${CHAT_FOCUSZONE_ATTRIBUTE}] .ui-chat__item > [${IS_FOCUSABLE_ATTRIBUTE}]`, | ||
`[${CHAT_FOCUSZONE_ATTRIBUTE}] .ui-chat__message[${IS_FOCUSABLE_ATTRIBUTE}="true"]`, | ||
) | ||
return chatItemsElements.length > 0 | ||
? (chatItemsElements[chatItemsElements.length - 1] as HTMLElement) | ||
|
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.