Set Text Writing Direction when using Lexical js to build text editor app

29 Views Asked by At

Im using facebook/lexical to build a custom text editor, im trying to add option to manually change the text writing direction either ltr or rtl

ive tried setDirection("ltr" or "rtl") but the code does nothing, i was expecting it to work, and theres not other option i can think of now, i was hoping setDirection() would update the dir attribute of the Element,

how can i get it to to work, such that the dir attribute is updated properly, and i can also get it back when i consume the export from lexical to prefill the editor, when updating the contents

0

There are 0 best solutions below