Skip to content

Commit

Permalink
refactor: Only focus year selector button when switching between views
Browse files Browse the repository at this point in the history
  • Loading branch information
motss committed Mar 13, 2020
1 parent 9aeb37c commit 200d0f0
Show file tree
Hide file tree
Showing 25 changed files with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/datepicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -709,8 +709,13 @@ export class Datepicker extends LitElement {
}
}

// Focus year selector button when switches to calendar view.
if ('calendar' === startView) this._focusElement('[part="year-selector"]');
/**
* When `_startView` is previously defined which means not first updated but switching from
* another view, focus year selector button.
*/
if (changed.get('_startView') && 'calendar' === startView) {
this._focusElement('[part="year-selector"]');
}
}

/**
Expand Down
Binary file modified src/tests/snapshots/app-datepicker-dialog/attributes-0-chrome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/tests/snapshots/app-datepicker-dialog/attributes-1-chrome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/tests/snapshots/app-datepicker-dialog/properties-0-chrome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/tests/snapshots/app-datepicker-dialog/properties-1-chrome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/tests/snapshots/app-datepicker/attributes-0-chrome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/tests/snapshots/app-datepicker/attributes-0-firefox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/tests/snapshots/app-datepicker/attributes-1-chrome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/tests/snapshots/app-datepicker/attributes-1-firefox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/tests/snapshots/app-datepicker/properties-0-chrome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/tests/snapshots/app-datepicker/properties-0-firefox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/tests/snapshots/app-datepicker/properties-1-chrome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/tests/snapshots/app-datepicker/properties-1-firefox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/tests/snapshots/app-datepicker/timezones-chrome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/tests/snapshots/app-datepicker/timezones-firefox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 200d0f0

Please sign in to comment.