11 ms·
Yeah, I really wanted to avoid them too. There doesn't seem a good way. The issue you describe with selection jumping is a well known issue with GBoard. Here's
by trueadm 4y ago
Yeah, I really wanted to avoid them too. There doesn't seem a good way. The issue you describe with selection jumping is a well known issue with GBoard. Here's the logic for the mutation handling:
https://github.com/facebook/lexical/blob/main/packages/lexical/src/LexicalMutations.ts https://github.com/facebook/lexical/blob/main/packages/lexic...
- jitl 4y agohttps://github.com/facebook/lexical/blob/5802651c24d88b2f7d27253749f55cb8ffa3b12b/packages/lexical/src/LexicalMutations.ts#L259 https://github.com/facebook/lexical/blob/5802651c24d88b2f7d2... > // Check for any random auto-added <br> elements, and remove them. > // These get added by the browser when we undo the above mutations > // and this can lead to a broken UI. This made me laugh out loud. Browsers! Until here our approach looked quite similar. Leave the observer connected during reverts and avoiding double-peocessing using .takeRecords never occurred to me, I always disconnect it. Maybe some of these brs are causing chaos…
- trueadm 4y agoNow thinking about it, I don't know why we didn't just do that. There must have been a reason, but I really can't recall what it was. If you're ever interested in contributing, this would be an epic contribution! :D