Skip to content

Commit a389256

Browse files
mlopezFCjavier-godoy
authored andcommitted
fix: remove slot only for child menu items
1 parent 19696cc commit a389256

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/main/java/com/flowingcode/addons/applayout/SlottedMenuItem.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ protected void onAttach(AttachEvent attachEvent) {
3131
if (getParent().orElse(null) instanceof SlottedMenuItem) {
3232
getElement().setAttribute("slot", "menu-item");
3333
} else {
34-
getElement().removeAttribute("slot");
34+
if ("menu-item".equals(getElement().getAttribute("slot"))) {
35+
getElement().removeAttribute("slot");
36+
}
3537
}
3638
super.onAttach(attachEvent);
3739
}

src/main/java/com/flowingcode/addons/applayout/ToolbarIconButton.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
*/
2020
package com.flowingcode.addons.applayout;
2121

22+
import com.vaadin.flow.component.Component;
2223
import com.vaadin.flow.component.HasEnabled;
2324
import com.vaadin.flow.component.Tag;
2425
import com.vaadin.flow.component.dependency.JsModule;
@@ -31,7 +32,7 @@
3132
@NpmPackage(value = "@polymer/paper-icon-button", version = "3.0.2")
3233
@JsModule("@polymer/paper-icon-button/paper-icon-button.js")
3334
@Tag("paper-icon-button")
34-
public class ToolbarIconButton extends SlottedMenuItem
35+
public class ToolbarIconButton extends Component
3536
implements HasEnabled,
3637
HasMenuItemCommands<ToolbarIconButton>,
3738
HasMenuItemIcon<ToolbarIconButton> {

0 commit comments

Comments
 (0)