spectacle icon indicating copy to clipboard operation
spectacle copied to clipboard

template() should be rendered on every slide in ?exportMode=true

Open hinok opened this issue 5 years ago • 1 comments

Describe Your Environment

What version of Spectacle are you using? (can be found by running npm list spectacle)

[email protected]

What version of React are you using? (can be found by running npm list react)

[email protected]

What browser are you using?

chrome (newest version)

What machine are you on?

macOS / macbook pro

Describe the Problem

When template is used like

const template = () => (
  <FlexBox
    justifyContent="space-between"
    position="absolute"
    bottom={0}
    width={1}
  >
    <Box padding="0 1em">
      <FullScreen />
    </Box>
    <Box padding="1em">
      <Progress />
    </Box>
  </FlexBox>
);

const App = () => (
  <Deck theme={theme} template={template} transitionEffect="fade">

The problem is not visible in examples because <Progress /> has always the same shape and doesn't render as a glitch, but when you use something more dynamic like page numbers:

const template = ({ slideNumber, numberOfSlides }) => (
  <FlexBox
    justifyContent="space-between"
    position="absolute"
    bottom={0}
    width="100%"
  >
    <Box padding="2">
      <FullScreen />
    </Box>
    <Text fontSize="20px">
      {slideNumber + 1} / {numberOfSlides}
    </Text>
  </FlexBox>
);

Then in ?exportMode=true it will render that template as many times as slides, all of them on the 1st page.

Zrzut ekranu 2020-05-4 o 22 29 12
  • https://codesandbox.io/s/simple-spectacle-example-vg5ug
  • https://vg5ug.csb.app/?exportMode=true

Expected behavior: [What you expect to happen] template() should be rendered on every slide in ?exportMode=true

Actual behavior: [What actually happens]

template() is rendered as many times as number of slides on the "1st page" in ?exportMode.

Additional Information

N/A

hinok avatar May 04 '20 20:05 hinok

Confirmed this is still kind of a bug in the latest version, except it prints the same page number on every exported page: https://codesandbox.io/s/template-behavior-in-exportmode-spectacle-30w3ly

fritz-c avatar Sep 20 '22 18:09 fritz-c