Skip to content

Commit

Permalink
[DEV-10975] Disable linking functionality for Title & Subtitle
Browse files Browse the repository at this point in the history
  • Loading branch information
e1himself committed Jun 9, 2023
1 parent d55953e commit 1e0e689
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ export function RichFormattingMenu({
const isInsideTable = TablesEditor.isTablesEditor(editor) && TablesEditor.isInTable(editor);
const isInsideTableHeader = isInsideTable && TablesEditor.isHeaderCell(editor);

const isTitleSelected = formatting.active.includes(HeadingRole.TITLE);
const isSubtitleSelected = formatting.active.includes(HeadingRole.SUBTITLE);

return (
<TextSelectionPortalV2
containerElement={containerElement}
Expand Down Expand Up @@ -234,16 +237,13 @@ export function RichFormattingMenu({
withItalic
withUnderline
// formatting
withFormatting={
formatting.active.includes(HeadingRole.TITLE) ||
formatting.active.includes(HeadingRole.SUBTITLE)
? 'readonly'
: true
}
withFormatting={isTitleSelected || isSubtitleSelected ? 'readonly' : true}
withAlignment={withAlignment}
withBlockquotes={withBlockquotes && !isInsideTable}
withHeadings={withHeadings && !isInsideTable}
withInlineLinks={withInlineLinks}
withInlineLinks={
isTitleSelected || isSubtitleSelected ? false : withInlineLinks
}
withLists={withLists}
withParagraphs={withParagraphs}
withTitle={formatting.aggregate === HeadingRole.TITLE}
Expand Down

0 comments on commit 1e0e689

Please sign in to comment.