Skip to content

Conversation

@lorejoh12
Copy link
Contributor

Pull request checklist

Description of changes

Updating the rest of the styling for the calendar component to latest design guidelines. Also fixing some bugs in Calendar and DatePicker.

Fixing one of the bugs referenced in #3300, with Datepicker's disableAutoFocus not preventing focus after click. Not resolving it since it was a more expansive feature request.

Fixes #4415 by wrapping the date picker in a focusTrapZone, making it so that focus stays inside while tabbing and goes back to beginning or end. DatePicker will close on ESC key or after selecting a date.

Fixes #4623 by removing the custom logic for resetting focus on dismiss of the date picker. Now we rely on FocusTrapZone to reset the focus back where it should go when the date picker closes, which resolves the issue.

inside MSFT can see this link for updates: http://jolore/fabric/#/examples/calendar

Focus areas to test

(optional)

@lorejoh12 lorejoh12 requested a review from dzearing May 3, 2018 18:30
}

private _onSelectMonthKeyDown = (index: number): (ev: React.KeyboardEvent<HTMLElement>) => void => {
return (ev: React.KeyboardEvent<HTMLElement>) => this._onKeyDown(() => this._onSelectMonth(index), ev);
Copy link
Member

@KevinTCoughlin KevinTCoughlin May 4, 2018

Choose a reason for hiding this comment

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

Do you want both ENTER and SPACE because otherwise onClick will work for both mouse and SPACE since its a <button/>. I ask because I recently fixed a semi-related bug where buttons were firing their handlers twice #4662.

If we continue with this approach, I do think we can reduce this function signature by at least eliminating one closure, but I need to try myself with code.

Copy link
Contributor Author

@lorejoh12 lorejoh12 May 8, 2018

Choose a reason for hiding this comment

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

For the SPACE issue, good call, that was an unintentional bug. Should be fixed now. Removed the "|| key.space" in the callback so that space will only fire the onClick callback

} from '../../Utilities';
import { compareDates, compareDatePart } from '../../utilities/dateMath/DateMath';
import * as stylesImport from './DatePicker.scss';
import { FocusTrapZone } from 'office-ui-fabric-react/lib/FocusTrapZone';
Copy link
Member

Choose a reason for hiding this comment

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

This import should be a relative path.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed now, thanks for helping figure this out David

@dzearing dzearing merged commit d7ca31c into microsoft:master May 15, 2018
laxmikankanala pushed a commit to laxmikankanala/office-ui-fabric-react that referenced this pull request May 15, 2018
* fixing focusZone algnment issue

* calendar styling and functionality updates

* undoing focusZone change

* initial commit

* making all the styling updates Hiroshi requested

* adding change file

* undoing focustrapzone change, updating snapshots

* implementing the rest of the styling changes from Hiroshi's designs

* fixing issue where navigating was not highlighting month picker correctly

* updating snapshots

* fixing issue where enter key didn't work in month picker

* updating styling, fixing focus and focus trap bugs in datepicker and calendar component

* fixing focus borders

* adding change file

* undoing unnecessary example change

* fixing bug with space key double selecting

* removing old change file

* fixing static import to relative import

* fixing bug when quickly moving in and out with the mouse

* fixing the rounded corners from datePicker applying incorrectly to calendar

* Revert "fixing the rounded corners from datePicker applying incorrectly to calendar"

This reverts commit 6bdc494.

* adding back fix for quickly mousing in and out of component
@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 31, 2019
@lorejoh12 lorejoh12 deleted the jolore/CalendarUpdates branch September 12, 2019 16:49
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.

DatePicker steals focus on dismiss Accessibility -DatePicker - focus should stay inside callout until date is selected or picker is dismissed

3 participants