Skip to content

Conversation

@sopranopillow
Copy link
Contributor

@sopranopillow sopranopillow commented Apr 18, 2023

Previous Behavior

DatePicker would validate and format dates by default, but this didn't come with a way to handle errors when validating the input.

DatePicker adds a padding to the popup and therefore the padding within calendar clashes and makes the padding look too large:

image

New Behavior

DatePicker now offers onValidateError to provide the dev a way to know when there's an error in the validation of the input. The error may be of time required-input, out-of-bounds, and invalid-input.

without padding:
image

Related issues

Fixes #27643

@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 18, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit cc9f4f2:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@size-auditor
Copy link

size-auditor bot commented Apr 18, 2023

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: 37e17afbfa3bc7c1c4aeb5823a44ccf81870e67f (build)

@fabricteam
Copy link
Collaborator

fabricteam commented Apr 18, 2023

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-datepicker-compat
DatePicker Compat
222.649 kB
58.929 kB
223.13 kB
58.944 kB
481 B
15 B

🤖 This report was generated against 37e17afbfa3bc7c1c4aeb5823a44ccf81870e67f

@sopranopillow sopranopillow changed the title feat(react-datepicker-compat): Add error handling to DatePicker feat(react-datepicker-compat): Add error handling to DatePicker and update popup's padding Apr 19, 2023
@sopranopillow sopranopillow merged commit f7d88ee into microsoft:master Apr 20, 2023
@sopranopillow sopranopillow deleted the react-datepicker-compat/error-handling branch April 20, 2023 04:41
marcosmoura added a commit to marcosmoura/fluentui that referenced this pull request Apr 24, 2023
* master: (58 commits)
  fix(react-datepicker-compat): Make onValidationError onValidationResult so the error is updated when there's no longer an error (microsoft#27655)
  Fix `@fluentui/react-portal-compat`: to be compatible with React 18 (microsoft#27577)
  chore: fix versions of @fluentui/react-datepicker-compat (microsoft#27666)
  applying package updates
  applying package updates
  Make line chart screen reader accessible (microsoft#27632)
  fix(react-examples): Improve keyboard navigation in ContextualMenu.CustomMenuList (microsoft#25172)
  docs(react-textarea): Update examples to use Field (microsoft#27644)
  bugfix(react-dialog): `DialogTitle` root as `h2` by default (microsoft#27555)
  applying package updates
  chore: restructure stories, add separate category for flat tree (microsoft#27586)
  fix document link (microsoft#27499)
  fix(react): exclude React.HTMLAttributes defined `content` prop for Tooltip and TooltipHost Prop types to mitigate @types/react breaking changes (microsoft#27467)
  chore(react-tabs): adopts custom JSX pragma (microsoft#27640)
  fix: ContextualMenuSplitButton always sets aria-checked (does not leave it undefined) when it is checkable (microsoft#27650)
  feat(react-datepicker-compat): Move DatePicker compat to stable (microsoft#27378)
  bugfix(react-tree): fix parent navigation after independency from id (microsoft#27642)
  applying package updates
  feat(react-datepicker-compat): Add error handling to DatePicker and update popup's padding (microsoft#27637)
  feat(public-docsite): Add banner to React component pages to promote v9 (microsoft#27557)
  ...
marcosmoura pushed a commit to marcosmoura/fluentui that referenced this pull request Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DatePicker v9 has too much padding due to default padding of Popover

4 participants