We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0c59d90 commit a98cea8Copy full SHA for a98cea8
packages/lexical-playground/src/plugins/TableActionMenuPlugin/index.tsx
@@ -495,7 +495,19 @@ function TableActionMenu({
495
if ($isRangeSelection(selection) || $isTableSelection(selection)) {
496
const [cell] = $getNodeTriplet(selection.anchor);
497
const currentTextDirection = cell.getWritingMode();
498
- cell.setWritingMode(!currentTextDirection ? 'vertical-lr' : null);
+ const newTextDirection = !currentTextDirection ? 'vertical-lr' : null;
499
+ cell.setWritingMode(newTextDirection);
500
+
501
+ if ($isTableSelection(selection)) {
502
+ const nodes = selection.getNodes();
503
504
+ for (let i = 0; i < nodes.length; i++) {
505
+ const node = nodes[i];
506
+ if ($isTableCellNode(node)) {
507
+ node.setWritingMode(newTextDirection);
508
+ }
509
510
511
}
512
});
513
}, [editor]);
0 commit comments