File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -381,6 +381,7 @@ export default function Page(props: PageProps) {
381
381
ref = { mergeRefs ( inputRef , pageElement ) }
382
382
style = { {
383
383
[ '--scale-factor' as string ] : `${ scale } ` ,
384
+ backgroundColor : canvasBackground || 'white' ,
384
385
position : 'relative' ,
385
386
minWidth : 'min-content' ,
386
387
minHeight : 'min-content' ,
Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ export default function PageCanvas(props: PageCanvasProps) {
105
105
106
106
canvas . style . width = `${ Math . floor ( viewport . width ) } px` ;
107
107
canvas . style . height = `${ Math . floor ( viewport . height ) } px` ;
108
+ canvas . style . visibility = 'hidden' ;
108
109
109
110
const renderContext : RenderParameters = {
110
111
annotationMode : renderForms ? ANNOTATION_MODE . ENABLE_FORMS : ANNOTATION_MODE . ENABLE ,
@@ -120,7 +121,13 @@ export default function PageCanvas(props: PageCanvasProps) {
120
121
const cancellable = page . render ( renderContext ) ;
121
122
const runningTask = cancellable ;
122
123
123
- cancellable . promise . then ( onRenderSuccess ) . catch ( onRenderError ) ;
124
+ cancellable . promise
125
+ . then ( ( ) => {
126
+ canvas . style . visibility = '' ;
127
+
128
+ onRenderSuccess ( ) ;
129
+ } )
130
+ . catch ( onRenderError ) ;
124
131
125
132
return ( ) => cancelRunningTask ( runningTask ) ;
126
133
}
You can’t perform that action at this time.
0 commit comments