selectOnClick not working for sideMenu

Hi,

SelectOnClick is true but not working whenthe below code is implemented.

menuItem id matches the name of the image.

My sample code :

sideMenu.addItemSelectListener(new Consumer<SideMenu.ItemSelectEvent>() {
            @Override
            public void accept(SideMenu.ItemSelectEvent itemSelectEvent) {
                itemSelectEvent.getMenuItem().setIcon("branding/" + itemSelectEvent.getMenuItem().getId() + "_one.svg");
                if (previousSelectedItem != null) {
                    previousSelectedItem.setIcon("branding/" + previousSelectedItem.getId() + "_two.svg");
                }
                previousSelectedItem = itemSelectEvent.getMenuItem();
            }
        });

Thanks in advance.

Hi,

Could you please attach a small demo project that reproduces the problem?

Regards,
Gleb

Hi Gleb,

I above code is all there is. I have done nothing extra.

When I try to set Icon programmatically the selectOnClick does not working i.e. selected menuItem is not highlighted.
I have kept the icon name same as the menu id with suffix _one and _two.

Thanks in advance.

Hi,

Thank you for reporting the problem, I’ve created a GitHub issue.

Regards,
Gleb