Help with click listener for HMLabel in HybridMenu

I modified the method in Router Layout leftMenu.add(HMLabel.get() .withCaption(“Menu”) .withClickListener(e → getLeftMenu().toggleSize()) .withIcon(new Image(“./frontend/HybridMenu/Images/Logo.png”, " ")));

In Class HMLabel I modified following methods public HMLabel(String caption, Icon icon, ComponentEventListener clickListener) { build(caption, icon, clickListener); } private void build(String caption, Icon icon, ComponentEventListener clickListener) { withCaption(caption); withIcon(icon); if (clickListener != null) { withClickListener(clickListener); } }

public HMLabel withClickListener(ComponentEventListener clickListener) { addClickListener(clickListener); return this; }

private HMLabel addClickListener(ComponentEventListener clickListener) { addClickListener(clickListener); return this; } StackOverflow error because is recurrent calling itself

I have not been able to find another method to avoid this stackoverflow error

Only way to work is removing addClickListener(clickListener) but then the click link is eliminated

Please try to help


i have created a new release where there is now a method for the ClickListener. To enlighten you: The HMLabel uses the Label from Vaadin. This one has no ClickListener. So you got a StackOverflow every time, among other things because you had to write super. before. Here is an example of what that would have looked like:

public HMLabel addClickListener(ComponentEventListener clickListener) {
	return this;

The new version of the HybridMenu is 3.0.21.vaadin14.
I hope that I could help you.

Have a nice evening.

Thanks a lot for your response. I will try