feat: add dropdown toolbar buttons to Rich Editor#19278
Open
leek wants to merge 9 commits intofilamentphp:4.xfrom
Open
feat: add dropdown toolbar buttons to Rich Editor#19278leek wants to merge 9 commits intofilamentphp:4.xfrom
leek wants to merge 9 commits intofilamentphp:4.xfrom
Conversation
Enable grouping related tools (alignment, headings, etc.) into compact dropdown menus via associative array syntax in `toolbarButtons()` or by registering `RichEditorDropdownTool` instances in `tools()`. - Add `RichEditorDropdownTool` class with icon mode and select mode - Update `InteractsWithToolbarButtons` to resolve dropdown configs from associative entries, with proper cache invalidation and disable support - Add `paragraph` tool to core Rich Editor tools - Add dropdown CSS classes with dark mode support - Add ARIA roles for accessibility (menu, menuitem, aria-haspopup) - Add Alpine `dropdownOpen` state for managing open/close - Add 12 new Pest tests covering dropdown behavior
…tate - Use per-dropdown x-data/x-effect instead of shared parent dropdownOpen state - Split rendering into separate toIconDropdownHtml() and toSelectHtml() methods - Add Closure support for options - Restore getExtraAttributeBag() on trigger buttons and add aria-label - Use x-html/x-text with IIFE effects for reactive trigger updates - Improve chevron SVG with rounded stroke caps - Add focus-visible styles to trigger and option buttons - Remove dropdownOpen from Alpine JS component
Add static closure, backtick code references in comments, document dropdown toolbar buttons and paragraph tool, apply code style fixes.
…tons Allows users to switch dropdown toolbar buttons from icon mode to select mode (text labels) using the shorthand syntax, without needing to manually construct `RichEditorDropdownTool` instances.
danharrin
requested changes
Feb 28, 2026
Member
danharrin
left a comment
There was a problem hiding this comment.
Please refactor the implementation to use an object, such as ToolbarButtonGroup, to configure the groups instead of nested arrays. You could introduce a textualButtons() config method on that object instead of introducing selectModeDropdowns() for the entire editor.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
toolbarButtons()or by registeringRichEditorDropdownToolinstances intools()RichEditorDropdownToolsupports icon mode (inline row of icons) and select mode (vertical list with labels)paragraphtool to core Rich Editor toolsmenu,menuitem,aria-haspopup)paragraphtoolTest plan
hasToolbarButton()for dropdown options, cache invalidation, and group interopvendor/bin/pest tests/src/Forms/Components/RichEditorTest.php)composer cs)