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 doesn't close on blur when in a dialog #854

Closed
howudodat opened this issue Oct 16, 2023 · 0 comments
Closed

Popover doesn't close on blur when in a dialog #854

howudodat opened this issue Oct 16, 2023 · 0 comments
Assignees
Labels
bug Something isn't working version 2.x.x Version 2.x.x issues
Milestone

Comments

@howudodat
Copy link

Describe the bug
If a popover is inside a dialog it doesn't close on blur

To Reproduce
run the below code, click on send icon to show the popover, click anywhere except on the test me button and the popover doesn't close. Click on the test me button (now focus is in the popover) click anywhere outside the popover and it closes

Expected behavior
the popover should close when you click anywhere outside of it

	public class DlgTest extends Dialog {
		public DlgTest() {
			init(this);
			this.setWidth("90%");
			this.setHeight(Calc.sub(Unit.vh.of(100), Unit.px.of(50)));
			initHeader();
			this.setModal(true);
			this.setAutoClose(false);
		}

	
		protected void initHeader() {
			MdiIcon icnSend = Icons.send();
			Popover pop = Popover.create(icnSend)
				.setCloseOnBlur(true)
				.closeOnEscape(true)
				.setPosition(DropDirection.BOTTOM_MIDDLE)
				.appendChild(Card.create("Card Title")
				.appendChild(Button.create("Test Me"))
				.addCss(dui_bg_accent, dui_fg, dui_elevation_0, dui_m_2px, dui_rounded_sm)
			);

			NavBar nav = NavBar.create().addCss(dui_dialog_nav)
				.setTitle("Test Dialog")
				.appendChild(PostfixAddOn.of(icnSend))
				.appendChild(PostfixAddOn.of((Icons.close().clickable().addClickListener(e -> close()))));


			getHeader().appendChild(nav);
		}
	}

	/**
	 * This is the entry point method.
	 */
	public void onModuleLoad() {
		var layout = AppLayout.create("Domino-ui test");
		body().appendChild(layout);

		new DlgTest().open();
	}

you can also grab a full test project from: https://github.com/howudodat/domtest

@vegegoku vegegoku self-assigned this Oct 29, 2023
@vegegoku vegegoku added bug Something isn't working version 2.x.x Version 2.x.x issues labels Oct 29, 2023
@vegegoku vegegoku added this to the 2.0.0-RC4 milestone Oct 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working version 2.x.x Version 2.x.x issues
Projects
Status: Done
Development

No branches or pull requests

2 participants