Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(richtext-lexical): allow customizing maxActiveItems for toolbar groups #9417

Merged
merged 3 commits into from
Nov 21, 2024

Conversation

AlessioGr
Copy link
Member

@AlessioGr AlessioGr commented Nov 21, 2024

Previously, they were hardcoded to 1. This is useful for lexical toolbar groups where multiple items can be active at the same time.

Example

Within your own lexical feature, you decide to add text format options to a dropdown toolbar. Since text can be both bold and italic, you want to allow multiple toolbar items to have an active state.

To do that, simply add the maxActiveItems property to the toolbar group:

toolbarFixed: {
  groups: [
    {
      type: 'dropdown',
      ChildComponent: MyIcon,
      items: groupItems,
      key: ‘formats',
      order: 20,
      maxActiveItems: 10, // <==
    }
  ]
}

@AlessioGr AlessioGr changed the title feat(richtext-lexical): allow customizing maxActiveItems prop of toobar groups feat(richtext-lexical): allow customizing maxActiveItems prop of toolbar groups Nov 21, 2024
@AlessioGr AlessioGr changed the title feat(richtext-lexical): allow customizing maxActiveItems prop of toolbar groups feat(richtext-lexical): allow customizing maxActiveItems for toolbar groups Nov 21, 2024
@AlessioGr AlessioGr enabled auto-merge (squash) November 21, 2024 22:26
@AlessioGr AlessioGr merged commit 38de760 into main Nov 21, 2024
56 checks passed
@AlessioGr AlessioGr deleted the feat/lexical/maxactiveitems branch November 21, 2024 23:53
Copy link
Contributor

🚀 This is included in version v3.1.0

kendelljoseph pushed a commit that referenced this pull request Feb 21, 2025
…groups (#9417)

Previously, they were hardcoded to 1. This is useful for lexical toolbar
groups where multiple items can be active at the same time.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant