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

fix(react-calendar-compat): Classnames removed and added to day cells need to be split instead of providing a string with spaces #29611

Merged

Conversation

sopranopillow
Copy link
Contributor

Previous Behavior

The classnames added/removed in day cells were the result of a makeStyles call, therefore these items contained spaces like this: classname1 classname2 classname3. This is an issue when using classList.add/remove since spaces are not handled, this results in an error:

InvalidCharacterError
Failed to execute 'add' on 'DOMTokenList': The token provided (' ') contains HTML space characters, which are not valid in tokens.

New Behavior

The classnames used in remove/add are now sanitized by splitting through spaces.

@sopranopillow sopranopillow self-assigned this Oct 20, 2023
@sopranopillow sopranopillow requested a review from a team as a code owner October 20, 2023 19:29
@codesandbox-ci
Copy link

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 073bac2:

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

@fabricteam
Copy link
Collaborator

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-calendar-compat
Calendar Compat
141.288 kB
36.81 kB
141.324 kB
36.821 kB
36 B
11 B
react-datepicker-compat
DatePicker Compat
212.458 kB
59.316 kB
212.494 kB
59.326 kB
36 B
10 B

🤖 This report was generated against c8ed0b5e2a48e82c30c9b257ae398cc6835b3a3b

@size-auditor
Copy link

size-auditor bot commented Oct 20, 2023

Asset size changes

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

Baseline commit: c8ed0b5e2a48e82c30c9b257ae398cc6835b3a3b (build)

@fabricteam
Copy link
Collaborator

🕵 fluentuiv9 No visual regressions between this PR and main

@sopranopillow sopranopillow merged commit 2b55f6c into microsoft:master Oct 20, 2023
@sopranopillow sopranopillow deleted the calendar-compat/class-injection branch October 20, 2023 22:34
marcosmoura added a commit to marcosmoura/fluentui that referenced this pull request Oct 24, 2023
* master: (48 commits)
  fix(react-drawer): regression with mountNode prop not available after refactoring (microsoft#29524)
  feat(react-storybook-addon-codesandbox): support various providers for "export to" functionality (microsoft#29536)
  feat(TimePicker-compat): call onTimeSelect on blur (microsoft#29597)
  feat: (breadcrumb) Removed appearance prop (microsoft#29554)
  chore(deps): bump fsevents from 1.2.9 to 1.2.13 (microsoft#29476)
  Adding comment in Hovercard that we support cumulative area chart currently (microsoft#29395)
  applying package updates
  applying package updates
  chore(vr-tests-react-components, perf-tests-app): Remove infobutton from vr-tests and perf test app (microsoft#29603)
  docs: Add guidance for modifying textarea's height. (microsoft#29601)
  fix(react-calendar-compat): Classnames removed and added to day cells need to be split instead of providing a string with spaces (microsoft#29611)
  [Part 2] Changes to onboard charting to fluent docsite (microsoft#29608)
  chore: bump jest to 29.7.0 (microsoft#29298)
  applying package updates
  feat(react-infolabel, react-components): Release InfoLabel to stable (microsoft#29585)
  feat(react-datepicker-compat): Update DatePicker to use react-calendar-compat (microsoft#29587)
  feat: adds motion to DialogSurface (microsoft#29391)
  fix: Use correct target windows for ResizeObserver (microsoft#29551)
  chg (microsoft#29592)
  Fix missing x callout custom callout (microsoft#29547)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants