File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -271,18 +271,24 @@ function getDropdownProps(item: EditorToolbarDropdownItem) {
271271 })
272272}
273273
274- function mapDropdownItem(item : EditorToolbarDropdownChildItem ) {
275- // If it's a separator or label (no 'kind' property), return as is
274+ function mapDropdownItem(item : EditorToolbarDropdownChildItem ): any {
275+ // Recursively map children if present
276+ const children = ' children' in item && Array .isArray (item .children )
277+ ? item .children .map (mapDropdownItem )
278+ : undefined
279+
280+ // If it's a separator or label (no 'kind' property), return with mapped children
276281 if (! (' kind' in item )) {
277- return item
282+ return children ? { ... item , children } : item
278283 }
279284
280285 const editorToolbarItem = item as EditorToolbarDropdownChildItem
281286 return {
282287 ... editorToolbarItem ,
288+ ... (children && { children }),
283289 active: isActive (editorToolbarItem ),
284290 disabled: isDisabled (editorToolbarItem ),
285- onClick : (e : MouseEvent ) => onClick (e , editorToolbarItem )
291+ onSelect : (e : Event ) => onClick (e as MouseEvent , editorToolbarItem )
286292 }
287293}
288294
You can’t perform that action at this time.
0 commit comments