Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DatePicker: Restore focus after cycling out of the callout #1477

Merged
merged 6 commits into from Apr 12, 2017
Merged

DatePicker: Restore focus after cycling out of the callout #1477

merged 6 commits into from Apr 12, 2017

Conversation

c-w
Copy link
Contributor

@c-w c-w commented Apr 11, 2017

Pull request checklist

  • Addresses an existing issue: #1266
  • Include a change request file if publishing
  • New feature, bugfix, or enhancement
    • Includes tests
  • Documentation update

Description of changes

After focus leaves the date picker, it skips everything else on the page, making it impossible to tab through the whole page. This pull request fixes this behavior by restoring focus to the date picker's text input after the picker is dismissed.

Focus areas to test

Test steps (verified manually on DatePicker.Input.Example: screencast):

  1. Tab through the picker until the focus exists. Focus should be restored to the picker's input field.
  2. Continue tabbing through the document below the picker.

(Split out from #1451)

@@ -158,6 +158,12 @@ export class Calendar extends BaseComponent<ICalendarProps, ICalendarState> impl
if (ev.which === KeyCodes.enter) {
ev.preventDefault();
this._onGotoToday();
} else if (ev.which === KeyCodes.tab && !ev.shiftKey) {
Copy link
Collaborator

@MLoughry MLoughry Apr 11, 2017

Choose a reason for hiding this comment

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

You should add similar logic for shift+tab on the first tab stop of the Calendar

Copy link
Contributor Author

@c-w c-w Apr 11, 2017

Choose a reason for hiding this comment

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

Done in 61b91e3

@c-w
Copy link
Contributor Author

@c-w c-w commented Apr 12, 2017

Quick ping to @MLoughry to hit the merge button before the master advances again :)

@micahgodbolt
Copy link
Member

@micahgodbolt micahgodbolt commented Apr 12, 2017

@c-w do you not have merge access? We typically allow the PR creator to merge the PR once it has been approved. If not, I'll do it for you now.

@micahgodbolt micahgodbolt merged commit 184015d into microsoft:master Apr 12, 2017
1 check passed
@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.

None yet

4 participants