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

Popover is not closing under special configurations #8306

Closed
subITCSS opened this issue Dec 10, 2024 · 8 comments · Fixed by #8409
Closed

Popover is not closing under special configurations #8306

subITCSS opened this issue Dec 10, 2024 · 8 comments · Fixed by #8409
Assignees
Labels
enhancement New feature or request vaadin-popover

Comments

@subITCSS
Copy link

Description

When having a Popover defined like the following code, the Popover never closes when clicking the backdrop or via ESC - but it is defined to work with this.

Expected outcome

When having CloseOnEsc or OutideClick - the Popover should close in every condition when triggering the defined operations.

Minimal reproducible example

H3 popOverText = new H3("Hover to see");

Popover popover = new Popover();
popover.setTarget(popOverText);
popover.addThemeVariants(PopoverVariant.ARROW, PopoverVariant.LUMO_NO_PADDING);
popover.setPosition(PopoverPosition.END);
popover.setOpenOnClick(false);
popover.setCloseOnEsc(true);
popover.setOpenOnHover(false);
popover.setOpenOnFocus(false);
popover.setCloseOnEsc(true);
popover.setCloseOnOutsideClick(true);
popover.addOpenedChangeListener(e -> Notification.show("Changed OpenState: " + e.isOpened()));
popover.add(new Button("Close", e -> popover.close()));
Button popoverButton = new Button("Open PopOver", e -> popover.open());
add(popOverText, popoverButton);

base-gradle-vaadin.zip

Steps to reproduce

  1. Define a Popover with setOpenOnClick(false); and setCloseOnEsc(true); and setCloseOnOutsideClick(true);
  2. Open the Popover programatically
  3. try to close the opened Popover via ESC or outsideclick

Environment

Vaadin version(s): 24.5.7
OS: Windows 11
Variant: Gradle

Browsers

Issue is not browser related

@web-padawan web-padawan added vaadin-popover documentation Improvements or additions to documentation labels Dec 10, 2024
@web-padawan
Copy link
Member

Currently, setCloseOnOutsideClick() and setCloseOnEsc() only work if you have one of the opening triggers to be configured. When setting all of them to false the Popover can be only opened and closed programmatically.
This is an intended behavior that needs to be properly documented.

@subITCSS
Copy link
Author

Is there the possibility to enable this as a configuration (when having no opening trigger defined)?

@yuriy-fix
Copy link
Contributor

Could be considered as an enhancement request. @web-padawan, are there any technical limitations for that?

@yuriy-fix yuriy-fix added the enhancement New feature or request label Dec 12, 2024
@web-padawan
Copy link
Member

Currently, the vaadin-popover web component treats no opening trigger configured as "manual" mode (unlike tooltip, which requires setting manual explicitly). We could consider adding separate manual property for the popover as well, then we can enable closing on outside click / Esc key press unless manual is set to true.

@subITCSS
Copy link
Author

subITCSS commented Jan 6, 2025

@web-padawan In which version will it be included?

@web-padawan
Copy link
Member

The PR where this was fixed is technically a behavior altering change so I though that we could postpone it to 24.7 but in case if this is really problematic, maybe we could consider backporting to 24.6 as well. I'll discuss this with the team.

@subITCSS
Copy link
Author

Any updates on this? - It would be great to have this in the 24.6

@rolfsmeds
Copy link
Contributor

IMO the behavioral change is small enough, and better in line with developer expectations, that it could be safely backported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request vaadin-popover
Projects
None yet
4 participants