Lexical: Completed out table menu elements, logic pending

This commit is contained in:
Dan Brown
2024-08-03 18:01:54 +01:00
parent a27a325af7
commit e94ad78ea7
7 changed files with 409 additions and 66 deletions

View File

@ -24,7 +24,7 @@ export class EditorDropdownButton extends EditorContainerUiElement {
constructor(options: EditorDropdownButtonOptions, children: EditorUiElement[]) {
super(children);
this.childItems = children;
this.options = Object.assign(defaultOptions, options);
this.options = Object.assign({}, defaultOptions, options);
if (options.button instanceof EditorButton) {
this.button = options.button;
@ -61,7 +61,7 @@ export class EditorDropdownButton extends EditorContainerUiElement {
class: 'editor-dropdown-menu-container',
}, [button, menu]);
handleDropdown({toggle : button, menu : menu,
handleDropdown({toggle: button, menu : menu,
showOnHover: this.options.showOnHover,
onOpen : () => {
this.open = true;

View File

@ -44,5 +44,5 @@ export function handleDropdown(options: HandleDropdownParams) {
toggle.addEventListener('mouseenter', toggleShowing);
}
menu.addEventListener('mouseleave', hide);
menu.parentElement?.addEventListener('mouseleave', hide);
}