Custom Lexical Feature Toolbar Button Not Appearing (Payload 3.33.0) #12204
Closed
AdonisVillanueva
started this conversation in
Feature Requests & Ideas
Replies: 1 comment 1 reply
-
I got it to show up in both inline and fixed toolbar, now got another issue of it not triggering. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello Payload CMS community,
I'm trying to add a custom feature with a toolbar button to the Lexical rich text editor in my Payload 3.33.0 project, but the button is not appearing in the Lexical Editor toolbar. I've followed the documentation for creating server and client features and linking them.
I've created the following files for a simple "Test" feature:
src/fields/lexical/features/TestFeature.tsx
(Server Feature)src/fields/lexical/features/TestFeature.client.tsx (Client Feature)
src/fields/lexical/toolbar/TestButton.tsx (Toolbar Button Component)
src/fields/defaultLexical.ts (Including the feature)
I'm including the feature in the features array using the recommended function approach with defaultFeatures:
(Note: I have other standard features and a custom LinkFeature config explicitly listed in my actual defaultLexical.ts, but I've also tried the ...defaultFeatures approach as shown above, and the custom button still doesn't appear. When explicitly listing features, I encountered "type not found" errors for standard nodes like "link" and "horizontalrule").
The server starts without errors related to these files, but the "Test" button simply does not render in the fixed toolbar in the editor. The console logs inside TestButtonComponent and onSelect are not triggered, suggesting the component is not being loaded or registered correctly on the client side.
This issue seems potentially related to the client-side bundling or registration of custom features and their components. I saw a related discussion about Lexical client-side issues here: #11337
Any guidance or suggestions on how to troubleshoot this further would be greatly appreciated!
"react": "19.1.0",
"@lexical/react": "0.28.0",
"payload-vercel-website-template": "link:",
"@payloadcms/ui": "3.33.0",
"@payloadcms/richtext-lexical": "3.33.0",
Beta Was this translation helpful? Give feedback.
All reactions