-
Type: Task
-
Status: Open
-
Priority: Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: 3.0.x
-
Tags:
-
Team:UI
nuxeo-actions-menu does not work properly if a native HTML slot is used as slotted content.
Take the following custom element into consideration:
class CustomSlottedMenuElement extends Nuxeo.Element { static get is() { return 'my-custom-slotted-menu-element'; } static get template() { return polymer.html` <div style="max-width: 160px;"> <nuxeo-actions-menu> <slot> <nuxeo-slot slot="SLOT"></nuxeo-slot> </slot> </nuxeo-actions-menu> </div> `; } } customElements.define(CustomSlottedMenuElement.is, CustomSlottedMenuElement);
And the following use case:
<my-custom-slotted-menu-element> <nuxeo-preview-button document='{...}'></nuxeo-preview-button> <nuxeo-preview-button document='{...}'></nuxeo-preview-button> <nuxeo-preview-button document='{...}'></nuxeo-preview-button> <nuxeo-preview-button document='{...}'></nuxeo-preview-button> <nuxeo-preview-button document='{...}'></nuxeo-preview-button> </my-custom-slotted-menu-element>
Note that the children will be inside my-custom-slotted-menu-element's light DOM, and not inside the menu's, and also that the menu changes the actions' slot to "dropdown" when it needs to move them to the dropdown. Because the "dropdown" slot does not exist in the context of my-custom-slotted-menu-element, the actions disappear when the menu moves them to the "dropdown" slot.
A possible fix would be to wrap the actions in a custom menu action item element, whose parent is the action menu, and thus can be moved around with slot changes. However, this means that the action would have a different parent, which is likely to create issues with nuxeo slots and filters.
- causes
-
NXP-28977 Fix selection toolbar in ordered folders
- Resolved
- is related to
-
ELEMENTS-1012 Make nuxeo-slot compatible with native HTML slots
- Resolved