Browse Source

fix: eventContent custom content not rendering within print-mode

Adam Shaw 1 năm trước cách đây
mục cha
commit
0546ca7454
2 tập tin đã thay đổi với 9 bổ sung3 xóa
  1. 2 0
      CHANGELOG.md
  2. 7 3
      packages/core/src/CalendarRoot.tsx

+ 2 - 0
CHANGELOG.md

@@ -1,6 +1,8 @@
 ## unreleased
 
 - fix: fc-event-past className not attached to events that end midnight before today (#6120, #6486)
+- React/Vue/Angular connectors and @fullcalendar/adaptive:
+  - fix: eventContent custom content not rendering within print-mode (#7419)
 
 ## 6.1.10 (2023-11-28)
 

+ 7 - 3
packages/core/src/CalendarRoot.tsx

@@ -1,4 +1,4 @@
-import { ComponentChildren } from './preact.js'
+import { ComponentChildren, flushSync } from './preact.js'
 import { BaseComponent } from './vdom-util.js'
 import { CssDimValue } from './scrollgrid/util.js'
 import { CalendarOptions, CalendarListeners } from './options.js'
@@ -57,10 +57,14 @@ export class CalendarRoot extends BaseComponent<CalendarRootProps, CalendarRootS
   }
 
   handleBeforePrint = () => {
-    this.setState({ forPrint: true })
+    flushSync(() => {
+      this.setState({ forPrint: true })
+    })
   }
 
   handleAfterPrint = () => {
-    this.setState({ forPrint: false })
+    flushSync(() => {
+      this.setState({ forPrint: false })
+    })
   }
 }