FocusZone: reset alignment when receiving focus for first time#8439
FocusZone: reset alignment when receiving focus for first time#8439dzearing merged 5 commits intomicrosoft:masterfrom dzearing:focuszone-align
Conversation
|
@dzearing, snapshots need to be updated |
| top: 0, | ||
| bottom: 20, | ||
| left: 0, | ||
| right: 30 |
There was a problem hiding this comment.
Just curious, is this actually meant to overlap with Button B? (Button B's left is 20.)
| if (isImmediateDescendant) { | ||
| this._setFocusAlignment(this._activeElement); | ||
| if (isImmediateDescendant || !this._activeElement) { | ||
| this._setFocusAlignment(newActiveElement, true, true); |
There was a problem hiding this comment.
I'm still not sure about defaultActiveElement. I see in constructor that if defaultActiveElement prop is present, then _activeElement will be set in constructor. As a result, this code wouldn't be triggered. Is that intended when defaultActiveElement is used?
There was a problem hiding this comment.
Also I do see _activeElement set to null in a couple of places in this module. Wanted to make sure that it won't falsely trigger this code or cause issues...
There was a problem hiding this comment.
I don't think it will fix defaultActiveElement. Talked in person. We will not address that here and keep this scoped to the manual focus scenario.
|
🎉 Handy links: |
Pull request checklist
$ npm run changeDescription of changes
Now DatePicker and other scenarios using bidirectional FocusZones will reset focus alignment when receiving focus for the first time.
Microsoft Reviewers: Open in CodeFlow