1
0
Fork 0

get pages to render properly on pdf export when settings.only is an array

This commit is contained in:
Enoch Riese 2022-12-13 08:39:16 -06:00
parent b12696dcfa
commit 4bdbddb3d6
3 changed files with 20 additions and 2 deletions

View file

@ -55,6 +55,7 @@ const Stack = (props) => {
const { layout, stack, stackName, gist } = props
const stackLayout = layout.stacks?.[stackName]
const stackExists = typeof stackLayout?.move?.x !== 'undefined'
// Use a ref for direct DOM manipulation
const stackRef = useRef(null)
@ -75,12 +76,12 @@ const Stack = (props) => {
// Initialize drag handler
useEffect(() => {
// don't drag the pages
if (props.isLayoutPart) return
if (props.isLayoutPart || !stackExists) return
handleDrag(select(stackRef.current))
}, [rotate, stackRef, stackLayout])
// // Don't just assume this makes sense
if (typeof stackLayout?.move?.x === 'undefined') return null
if (!stackExists) return null
// These are kept as vars because re-rendering on drag would kill performance
// Managing the difference between re-render and direct DOM updates makes this