vivliostyle / vivliostyle.js

📖 The power of CSS typesetting, right at your fingertips.
https://vivliostyle.org
GNU Affero General Public License v3.0
606 stars 53 forks source link

bug(react): page prop is ignored on source changed #687

Open yukukotani opened 3 years ago

yukukotani commented 3 years ago

Describe the bug On source prop updated, the first page is always loaded regardless of page prop.

To Reproduce Steps to reproduce the behavior:

  1. yarn storybook to open storybook
  2. Set Page knob to 2
  3. Set Source knob to https://vivliostyle.github.io/vivliostyle_doc/samples/gutenberg/Alice.html
  4. The first page of "Alice" is shown.

Expected behavior The second page of "Alice" is shown in step 4.

Additional context

Found in https://github.com/vivliostyle/vivliostyle.js/issues/685

MurakamiShinyu commented 3 years ago

I think the Expected behavior can be also:

yukukotani commented 3 years ago

@MurakamiShinyu Yes, that's one of the options. But it means renderer component would have a constraint: page prop will be ignored when source is changed. So users of @vivliostyle/react must handle onLoad event and update page props by themselves.

I need some investigation but it seems that implementing my expected behavior is hard. Maybe we can pick your option first, then update to respect page props later.