epub.js icon indicating copy to clipboard operation
epub.js copied to clipboard

RTL issue when going to a specific chapter.

Open ahmadqwer opened this issue 5 years ago • 5 comments

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.

ahmadqwer avatar Nov 25 '20 13:11 ahmadqwer

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 .

OriKuttner avatar Nov 26 '20 06:11 OriKuttner

@OriIdan Thank you for your reply, but where should i change the scrollWidth?

ahmadqwer avatar Nov 26 '20 07:11 ahmadqwer

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 .

OriKuttner avatar Nov 26 '20 07:11 OriKuttner

@OriIdan i tried to use moveTo after displaying the chapter. rendition.moveTo(0) but it did not work.

ahmadqwer avatar Nov 26 '20 07:11 ahmadqwer

Do you have the below attribute defined in your epub spine tag

page-progression-direction="rtl"

alidbc avatar Jun 18 '21 17:06 alidbc