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

Correct calendar high contrast #6938

Merged
merged 24 commits into from
Nov 26, 2018
Merged

Correct calendar high contrast #6938

merged 24 commits into from
Nov 26, 2018

Conversation

jhellesen
Copy link
Contributor

@jhellesen jhellesen commented Nov 1, 2018

Pull request checklist

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

Existing calendar component has several issues in high contrast

  • Many buttons lack an active state different from hover state
  • Day buttons lacks clear hover / active states, especially as related to current day and selected day
  • No visual indicator current month / year
  • Hover / active state incorrect
  • Hover / active states for week / month are inconsistent from non-high contrast
  • Hover / active states for week / month have visual clipping
  • Rest color for 'Go to today' button

Focus areas to test

  • Should be no changes to non-high contrast other than correcting (regression) the font-size of the day buttons
  • The rest, hover and active states for the calendar day buttons when the date range type is day, week or month
  • The rest, hover and active states for the month / year buttons, the previous / next buttons
Microsoft Reviewers: Open in CodeFlow

… dates outside of the date boundary (minDate, maxDate) when DateRangeType.Week is used.
Divs were recently changes to buttons for accessibility and they inherited a button style for the font line height causing the text to shift downwards significantly inside the cells.  Switching back to the old default.
…out of range dates when DateRangeType is Month
…e updated high contrast rest / hover / active pattern.
…ive high contrast states for the current day and selected day.
1) Update calendar 'Go to today' button to appear as a link in high contrast mode
2) Update calendar day week and month selection types to conform with the updated rest / hover / active high contrast pattern
3) Fix calendar day selection bug where day text wasn't visible in high contrast
1) Fix issue where 'Go to today' link was broken
2) Fix issue where high contrast month hover state borders were not rounded
3) Fix issue where text in high contrast was shifting location for month, week and Month/Year hover states
@jhellesen jhellesen requested a review from a team as a code owner November 1, 2018 22:18
@natalieethell
Copy link
Contributor

Hey @jhellesen it looks like your snapshot tests failed. Is changing "Go to today" to " Go to today" (an extra space in front) intentional?

@jhellesen
Copy link
Contributor Author

Hey @jhellesen it looks like your snapshot tests failed. Is changing "Go to today" to " Go to today" (an extra space in front) intentional?

No, and it's fixed now. Thanks.

@natalieethell
Copy link
Contributor

Cool, thanks! It looks like the newest snapshot failure is due to the addition of disabled={true} in the "Renders simple calendar correctly" test. Do you know what could be causing this?

@jhellesen
Copy link
Contributor Author

jhellesen commented Nov 6, 2018

Cool, thanks! It looks like the newest snapshot failure is due to the addition of disabled={true} in the "Renders simple calendar correctly" test. Do you know what could be causing this?

Sorry - that was an intentional change. I've pushed out an update to the snapshot.


if (goTodayEnabled && navigatedDayDate && selectedDate) {
goTodayEnabled =
navigatedDayDate.getFullYear() !== selectedDate.getFullYear() || navigatedDayDate.getMonth() !== selectedDate.getMonth();
Copy link
Contributor

Choose a reason for hiding this comment

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

You probably meant to use "today" date rather than "selected" date.

Bug happens when you navigate to previous month, then select a day in the middle of the month, the go to today button gets disabled and it shouldn't

Copy link
Contributor

Choose a reason for hiding this comment

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

related bug, you're using getMonth() but that doesn't cover what days are actually visible - if you select a visible day at the beginning or end of the range that's in the previous month, the button gets enabled again even if it can't do anything.

@natalieethell
Copy link
Contributor

In the deploy demo link, I noticed that if you select a date in a different month than the current month, and then re-open the DatePicker, "Go to today" is disabled. Is that expected?

image

If I click on a month on the month picker, "Go to today" is enabled again.

@aneeshack4
Copy link
Contributor

@jhellesen Hello! I see that this PR has been open for quite some time, do you have any plans on fixing the screener visual regressions so that this can be merged? Please let us know if we can answer any questions!

@lorejoh12
Copy link
Contributor

@jhellesen Hello! I see that this PR has been open for quite some time, do you have any plans on fixing the screener visual regressions so that this can be merged? Please let us know if we can answer any questions!

These changes are actually intentional, not regressions. We had an existing bug for a while with the font inheritance being broken, so we actually need the changes to be approved. Our calendar designer doesn't have access to approve them- who do we need to talk to?

@natalieethell natalieethell requested a review from a team November 26, 2018 21:37
@natalieethell
Copy link
Contributor

@lorejoh12 Ben (@betrue-final-final) should be able to help you with those.

@lorejoh12 lorejoh12 merged commit 6ec50ae into microsoft:master Nov 26, 2018
@msft-github-bot
Copy link
Contributor

🎉office-ui-fabric-react@v6.108.0 has been released which incorporates this pull request.:tada:

Handy Links:

@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants