File tree 2 files changed +16
-2
lines changed
packages/lexical-table/src
2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -320,8 +320,7 @@ export class TableCellNode extends ElementNode {
320
320
prevNode . __rowSpan !== this . __rowSpan ||
321
321
prevNode . __backgroundColor !== this . __backgroundColor ||
322
322
prevNode . __writingMode !== this . __writingMode ||
323
- prevNode . __format !== this . __format ||
324
- this . getFormatType ( ) !== this . getChildFormatType ( )
323
+ prevNode . __format !== this . __format
325
324
) ;
326
325
}
327
326
Original file line number Diff line number Diff line change @@ -443,6 +443,21 @@ export function applyTableHandlers(
443
443
FORMAT_ELEMENT_COMMAND ,
444
444
( formatType ) => {
445
445
const selection = $getSelection ( ) ;
446
+ if (
447
+ $isSelectionInTable ( selection , tableNode ) &&
448
+ selection ! . getNodes ( ) . length === 1 &&
449
+ $isTextNode ( selection ! . getNodes ( ) [ 0 ] )
450
+ ) {
451
+ const tableCellNode = $findMatchingParent (
452
+ selection ! . getNodes ( ) [ 0 ] ,
453
+ $isTableCellNode ,
454
+ ) ;
455
+ if ( tableCellNode ) {
456
+ tableCellNode . setFormat ( formatType ) ;
457
+ }
458
+ return false ;
459
+ }
460
+
446
461
if (
447
462
! $isTableSelection ( selection ) ||
448
463
! $isSelectionInTable ( selection , tableNode )
You can’t perform that action at this time.
0 commit comments