Shouldn't Indentation be handled directly by create/update of ElementNode? #7924
Replies: 1 comment
-
|
I wasn't involved when these decisions were being made but there is nowhere to put this code in ElementNode because there is no default implementation of createDOM and updateDOM nor is there a method to call where you can run extra code that is supposed to cooperate with the result of createDOM and updateDOM. Given the current rendering architecture, the alternative would be to have some sort of function that you have to call in order to apply indentation to a node. Eventually the reconciler will be more customizable, there's some related work happening in #7885, but indentation isn't in the scope of that. It might make a nice follow-up (extract indentation application to a function in the editor's internal configuration so you can change how it works with an extension) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey! First of all, thank you for the incredible project.
Using lexical, i ended up rewriting a whole rich text editor from scratch. task wasn't easy but I learnt a lot of things through the process.
while working on lexical, I wanted to handle tab and indentations and realized that this part is :
my question is rather basic (and maybe already asked, but i didn't find anything discussing about the implementation choice) :
I'm feeling like this is an exception.
if I understand well how lexical work :
in indent case, it is a bit of both but does it make sense?
Beta Was this translation helpful? Give feedback.
All reactions