Skip to content

OverflowSet: Add Focus(with forceIntoFirstChild) and focusElement() functions#4485

Merged
jspurlin merged 3 commits intomicrosoft:masterfrom
jspurlin:jspurlin/OverflowSetAddFocusFunctions
Apr 9, 2018
Merged

OverflowSet: Add Focus(with forceIntoFirstChild) and focusElement() functions#4485
jspurlin merged 3 commits intomicrosoft:masterfrom
jspurlin:jspurlin/OverflowSetAddFocusFunctions

Conversation

@jspurlin
Copy link
Copy Markdown
Contributor

@jspurlin jspurlin commented Apr 7, 2018

Pull request checklist

  • Addresses an existing issue: Fixes #0000
  • Include a change request file using $ npm run change

Description of changes

Before OverflowSets didn't expose the goodness of being able to focus vs focus (firstChild), or a specific child element via foucsElement. This exposes the functionality that FocusZone has (and implements it for when it is not in a FocusZone)

Focus areas to test

Verified that this works as expected for both the case when the OverflowSet contains a FocusZone and when does not and everything works as expected

@jspurlin jspurlin requested a review from micahgodbolt as a code owner April 7, 2018 01:34
@jspurlin jspurlin changed the title OverflowSet: Add Foucs(firstChild) and focusElement() functions OverflowSet: Add Foucs(with forceIntoFirstChild) and focusElement() functions Apr 7, 2018
@christiango christiango changed the title OverflowSet: Add Foucs(with forceIntoFirstChild) and focusElement() functions OverflowSet: Add Focus(with forceIntoFirstChild) and focusElement() functions Apr 7, 2018
/**
* Sets focus to the button.
*/
focus: () => void;
Copy link
Copy Markdown
Contributor

@ddlbrena ddlbrena Apr 8, 2018

Choose a reason for hiding this comment

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

focus [](start = 2, length = 5)

is removing this not a breaking change? does CommandBar.base.tsx not need to be updated? #Closed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ups never mind, i guess that is why the parameter above is optional


In reply to: 179932909 [](ancestors = 179932909)

* Sets focus to a specific child element within the zone. This can be used in conjunction with
* onBeforeFocus to created delayed focus scenarios (like animate the scroll position to the correct
* location and then focus.)
* @param {HTMLElement} element The child element within the zone to focus.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

element [](start = 26, length = 7)

[nit] childElement or rename parameter to element to match implementation

* @param {HTMLElement} element The child element within the zone to focus.
* @returns True if focus could be set to an active element, false if no operation was taken.
*/
public focusElement(element: HTMLElement): boolean {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

element [](start = 22, length = 7)

does the parameter here not need to be marked as optional the to match the interface?

Copy link
Copy Markdown
Contributor

@ddlbrena ddlbrena left a comment

Choose a reason for hiding this comment

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

:shipit:

@jspurlin jspurlin merged commit c8f6d26 into microsoft:master Apr 9, 2018
@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants