richtext-lexical: `slashMenu.dynamicGroups` are dropped (self-concatenation in the merge, and not offered on a bare "/")

Open Beginner friendly
#19,317 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@muhammad-wasif-code is already working on this.

Since Nov 4, 2026.

  • #19320 by @muhammad-wasif-code — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
77/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
react, typescript
Domain
devtools, frontend

Research direction

Start in lexical/plugins/SlashMenu/index.js and trace how dynamicGroups are read, merged, and shown for a bare "/". Fix the merge to include dynamic items without mutating the configured group, preserve its menu position, and allow fetching when the query is empty. Check that dynamic groups work with an empty static groups array and with a function that declares no parameters; done when the reported cases display correctly.

Written by the indexing model from the issue text.

Description

Bug

Version: @payloadcms/richtext-lexical 4.0.0-beta.6

A client feature's slashMenu.dynamicGroups items never appear in the slash menu. In lexical/plugins/SlashMenu/index.js:

  1. Self-concatenation: when a dynamic group's key matches an existing group (e.g. basic), the merge does
    if (group?.items?.length) group.items = group.items.concat(group.items)
    
    It concatenates the existing group with itself and never adds dynamicGroup.items. Every dynamic item is lost, and the static items are duplicated in the mutated config object.
  2. Order: the matched group is filtered out and pushed to the end, so merging moves it to the bottom of the menu.
  3. Bare "/": dynamic groups are fetched and merged only if (queryString), so they never show for "/" with no query.
  4. Undocumented preconditions: dynamic groups are read only when the feature also declares static groups (an empty array works), and only when the dynamicGroups function declares a parameter (the code checks .length). Payload also doesn't filter dynamic items by the query, unlike static items. That last point may be intended, but it isn't documented.

Suggested fix: concatenate dynamicGroup.items, copy instead of mutating the config group, replace the matched group in place, and run the merge for queryString != null. We run this as a patch and can open a PR.

Dominant language
TypeScript
Stars
45.6k
Forks
4.4k
Avg merge
1d 23h
Merged PRs (30d)
237

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from payloadcms/payload

All issues in payloadcms/payload

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.