RTL issue when going to a specific chapter.
Hello,
Im loading an RTL book (Arabic), i got the TOC with the below code,
book.loaded.navigation.then((nav) => { toc = nav; });
Now when i want when the user click on the chapter (spine item) to go to that page, now i used the below to go to a specific chapter.
rendition.display(chapterUrl);
Now the above is working but instead of going to the begining of the chapter its going to the end of it !, i think it is because of the RTL thing.
Any solution for this issue?
Thank you.
It seems you have hit a bug in epub.js In the display function set it to go to 0 instead of scrollWidth after you have switched the chapter.
-- Ori Idan CEO Helicon Books http://www.heliconbooks.com
On Wed, Nov 25, 2020 at 3:59 PM ahmadqwer [email protected] wrote:
Hello,
Im loading an RTL book (Arabic), i got the TOC with the below code, book.loaded.navigation.then((nav) => { toc = nav; }); Now when i want when the user click on the chapter (spine item) to go to that page, now i used the below to go to a specific chapter. rendition.display(chapterUrl); Now the above is working but instead of going to the begining of the chapter its going to the end of it !, i think it is because of the RTL thing.
Any solution for this issue?
Thank you.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/futurepress/epub.js/issues/1155, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB43QBBSBP3LR6XEC77PP3SRUETJANCNFSM4UCN3NBA .
@OriIdan Thank you for your reply, but where should i change the scrollWidth?
You don't need to change scrollWidth, just go to 0 instead of scrollWidth as it is now. It should scroll to 0 at the end of the function after changing chapter.
On Thu, Nov 26, 2020 at 9:21 AM ahmadqwer [email protected] wrote:
@OriIdan https://github.com/OriIdan Thank you for your reply, but where should i change the scrollWidth?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/futurepress/epub.js/issues/1155#issuecomment-734122919, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB43QBQZCK7EA6LRNILNOTSRX6ZBANCNFSM4UCN3NBA .
@OriIdan i tried to use moveTo after displaying the chapter.
rendition.moveTo(0)
but it did not work.
Do you have the below attribute defined in your epub spine tag
page-progression-direction="rtl"