Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Lexical disable features

default discord avatar
cgilly2fast5 months ago
3
@360823574644129795

Let me know in a different thread that "The toolbar itself is a feature too. You need to add

InlineToolbarFeature

and/or

FixedToolbarFeature

", My new code that works is this, I moved to importing the features I want and adding vs filtering:

import {
  lexicalEditor,
  BoldFeature,
  UnderlineFeature,
  OrderedListFeature,
  UnorderedListFeature,
  LinkFeature,
  ItalicFeature,
  FixedToolbarFeature,
} from '@payloadcms/richtext-lexical'

 const field = {
      name: 'description',
      type: 'richText',
      label: 'Description',
      editor: lexicalEditor({
        features: [
          BoldFeature(),
          UnderlineFeature(),
          OrderedListFeature(),
          UnorderedListFeature(),
          LinkFeature(),
          ItalicFeature(),
          FixedToolbarFeature(),
        ],
      }),
    }


Does disabling features, remove the pop up toolbar that shows bold, italic etc? It appears to be the case for me, using payload 3.0 beta 113. If its belived ot be a bug I will make a bug report

  • default discord avatar
    iamlinkus12 months ago

    Thanks,

    @360823574644129795

    !

  • discord user avatar
    alessiogr
    last year

    Yea that's the way to do it! Or you can just not use

    defaultFeatures

    and provide all features yourself

  • default discord avatar
    iamlinkuslast year

    Hey, is there a better way to disable lexical features? I want to have only link, bold and italic features in my rich text. Here's how I'm doing it now (which seems a little cumbersome).

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.