Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting themeNames causes SubMenu to fail once #6577

Closed
mijutu opened this issue Aug 26, 2024 · 5 comments · Fixed by vaadin/web-components#7702
Closed

Setting themeNames causes SubMenu to fail once #6577

mijutu opened this issue Aug 26, 2024 · 5 comments · Fixed by vaadin/web-components#7702
Labels

Comments

@mijutu
Copy link

mijutu commented Aug 26, 2024

Description of the bug

Opening SubMenu fails once if the menu has been opened before and its theme names have been altered.

Expected behavior

SubMenu should open normally every time.

Minimal reproducible example

https://k2c42.dy.fi/tmp/submenu-autoclose-problem.tar.xz

Run with mvn and go to http://localhost:8080/

Versions

  • Vaadin / Flow version: 24.4.7, 24.4.10
  • Java version: 17.0.12+7-Debian-2deb12u1
  • Browser version: Firefox 115esr, Chromium 128

(Edited: More accurate description, even more minimal example)

@mijutu
Copy link
Author

mijutu commented Aug 26, 2024

I tried again. The problem is not related to navigation.

Running removeThemeNames on menu items is enough to cause SubMenu to fail to open once.

@mijutu mijutu changed the title Setting themeNames just before UI.navigate causes SubMenu to fail once after navigation Setting themeNames causes SubMenu to fail once Aug 26, 2024
@vaadin vaadin deleted a comment Aug 26, 2024
@mshabarov mshabarov transferred this issue from vaadin/flow Aug 27, 2024
@DiegoCardoso
Copy link
Contributor

Hi @mijutu,

Could you provide a snippet or perhaps a GH repro with the reproducible code? We would rather not download compressed files.

Thank you in advance.

@mijutu
Copy link
Author

mijutu commented Aug 28, 2024

Don't you people have disposable virtual machines? Or disposable virtual machines in some cloud setup so scary tars wouldn't even come close to your infrastructure?

var m = new MenuBar();
var hl = new HorizontalLayout(m);
hl.setWidthFull();
add(hl);
add(new Paragraph(
		"""
				This demonstrates a problem that appeared on Vaadin Flow from 24.4.7 to at least 24.4.10.
				First, open and close the drop down menu. Then click removeThemeNames or addThemeNames. Then try to open the drop down menu again. It closes immediately.
				Downgrading to 24.4.6, will fix the problem.
				"""));

var mi = m.addItem("☰");
var sm = mi.getSubMenu();
sm.addItem(new Span("Qwer"));
sm.addItem(new Span("Asdf"));
sm.addItem(new Span("Zxcv"));

hl.add(new Button("removeThemeNames", event -> {
	mi.removeThemeNames("selected-menuitem");
}));
hl.add(new Button("addThemeNames", event -> {
	mi.addThemeNames("selected-menuitem");
}));

@web-padawan
Copy link
Member

The underlying problem is most likely the same as in #6580 which will be fixed by vaadin/web-components#7702.

@DiegoCardoso
Copy link
Contributor

Confirmed that this issue is a regression caused by vaadin/web-components#7524

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@DiegoCardoso @web-padawan @mijutu and others