amirhhashemi / tiptap-text-direction

Text direction extension for Tiptap
https://www.npmjs.com/package/tiptap-text-direction
MIT License
38 stars 1 forks source link

How to detect current direction ? #14

Closed ramyahm2010 closed 7 months ago

ramyahm2010 commented 8 months ago

Hello,

Kindly, need a way to detect active current direction (rtl / ltr), i tried following:

editor.isActive({ textDirection: "rtl" });

but always returns false even if it's already current active direction !

amirhhashemi commented 8 months ago

Hi, Try this:

editor.isActive({ dir: "rtl" });

Because the global attribute's name is dir not textDirection. But I think textDirection makes more sense. I will update it in a future release.

ramyahm2010 commented 8 months ago

Thanks @amirhhashemi

Tried provided code & it's working fine.