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

feat(react-datepicker-compat): Add null to value prop and handle controlled cases correctly #28056

Merged

Conversation

sopranopillow
Copy link
Contributor

@sopranopillow sopranopillow commented May 30, 2023

Previous Behavior

Currently the controlled vs uncontrolled use cases are handled the same way as in v8. This is an issue since v8 switches between controlled and controlled without warning.

New Behavior

To avoid this issue and continue using the useControllableState hook, the null type was added to the value prop to handle the controlled cases with null.

Related Issue(s)

@sopranopillow sopranopillow self-assigned this May 30, 2023
@sopranopillow sopranopillow requested review from a team and khmakoto as code owners May 30, 2023 22:49
@msft-fluent-ui-bot msft-fluent-ui-bot added the Component: DatePickerCompat react-datepicker-compat label May 30, 2023
@fabricteam
Copy link
Collaborator

fabricteam commented May 30, 2023

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-datepicker-compat
DatePicker Compat
222.596 kB
59.214 kB
222.522 kB
59.185 kB
-74 B
-29 B

🤖 This report was generated against 0eae1bc208e0d69febb4bc1e70ab1e2c7c96b623

@codesandbox-ci
Copy link

codesandbox-ci bot commented May 30, 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 4bbb936:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration
old-leftpad-82fusz Issue #27931

@size-auditor
Copy link

size-auditor bot commented May 30, 2023

Asset size changes

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

Baseline commit: 0eae1bc208e0d69febb4bc1e70ab1e2c7c96b623 (build)

@fabricteam
Copy link
Collaborator

fabricteam commented May 30, 2023

🕵 fluentuiv9 No visual regressions between this PR and main

@sopranopillow sopranopillow marked this pull request as draft May 31, 2023 21:47
@sopranopillow sopranopillow marked this pull request as ready for review May 31, 2023 21:58
@sopranopillow sopranopillow merged commit 16a2631 into microsoft:master Jun 6, 2023
26 checks passed
@sopranopillow sopranopillow deleted the datepicker-compat/controlled branch June 6, 2023 16:42
marcosmoura added a commit to marcosmoura/fluentui that referenced this pull request Jun 13, 2023
* master:
  applying package updates
  doc: Remove wrong recommendation from input (microsoft#28168)
  fix: Outline color now respects OS force colors settings (microsoft#28182)
  Datepicker onCalendarOpenStateChange prop (microsoft#28136)
  feat(react-file-type-icons): Add getFileTypeIconAsUrl utility (microsoft#27336)
  applying package updates
  [FIX] Updates selection dot and label positioning for ChoiceGroupOption when an Image or Icon is present. (microsoft#28173)
  chore(react-infobutton): Rename InfoTip to InfoIcon (microsoft#28177)
  fix(react-datepicker-compat): Make DatePicker Compat stories SSR safe (microsoft#28017)
  Added `tab` focus mode to the Breadcrumb (microsoft#28046)
  docs: Add usable documentation (microsoft#28155)
  applying package updates
  Fix up rebase code (microsoft#27864)
  fix: ContextualMenu indexing in sections (microsoft#28127)
  applying package updates
  fix: Layer sets focus visible classname for its FocusRectsProvider (microsoft#28157)
  docs(react-infobutton): Update stories to show better guidance (microsoft#28144)
  fix(react-avatar): Do not render the image when src prop is undefined (microsoft#28146)
  feat(react-datepicker-compat): Add null to value prop and handle controlled cases correctly (microsoft#28056)
@msft-fluent-ui-bot
Copy link
Collaborator

🎉@fluentui/react-datepicker-compat@v0.1.6 has been released which incorporates this pull request.:tada:

Handy links:

@msft-fluent-ui-bot
Copy link
Collaborator

🎉@fluentui/react-components@v9.22.0 has been released which incorporates this pull request.:tada:

Handy links:

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.

[Bug]: DatePicker - Unable to Create Controlled Instance of DatePicker with No Default Date
4 participants