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
Back button allows page change when a modal window is shown. #4555
Comments
Originally by @Artur- A lot of tickets have been left hanging in the issue tracker through the years. Some of them are still relevant, some of them have been fixed a long time ago and some are no longer valid. To get a better look on what is important and still relevant, we are closing old tickets which have not been touched in a long time. No further work will be done on this ticket unless someone indicates that it's still relevant. If this ticket is still relevant to you, please reopen it. |
Originally by timohartmann I still have the same problem. Using vaadin version 7.3.3 |
Originally by bstumm Vaadin Version 7.4.1. Problem still exists. When an modal window is open, it will stay open, and the application state in the background changes. |
Originally by @MTzukanov I succeeded in preventing this by using a custom UriFragmentManager. Here's the code: public class TestnavigatorUI extends UI {
@WebServlet(value # "/*", asyncSupportedtrue)
@VaadinServletConfiguration(productionMode # false, uiTestnavigatorUI.class)
public static class Servlet extends VaadinServlet {
}
@Override
protected void init(VaadinRequest request) {
Navigator navigator = new Navigator(this, new CustomUriFragmentManager(getPage()),
new Navigator.SingleComponentContainerViewDisplay(this));
navigator.addView("", new MyView("view 1"));
navigator.addView("test2", new MyView("view 2"));
navigator.addView("test3", new MyView("view 3"));
}
class MyView extends VerticalLayout implements View {
public MyView(String caption) {
addComponent(new Button(caption, e -> {
Window window = new Window();
window.setModal(true);
UI.getCurrent().addWindow(window);
}));
}
@Override
public void enter(ViewChangeEvent event) {}
}
private boolean isModalWindowShown() {
return getWindows().stream().anyMatch(Window::isModal);
}
class CustomUriFragmentManager extends UriFragmentManager {
private String uriFragment = Page.getCurrent().getUriFragment();
public CustomUriFragmentManager(Page page) {
super(page);
}
@Override
public void uriFragmentChanged(UriFragmentChangedEvent event) {
if (!isModalWindowShown()) {
uriFragment = event.getUriFragment();
super.uriFragmentChanged(event);
} else {
Page.getCurrent().setUriFragment(uriFragment, false);
}
}
}
} |
Hello there! It looks like this issue hasn't progressed lately. There are so many issues that we just can't deal them all within a reasonable timeframe. There are a couple of things you could help to get things rolling on this issue (this is an automated message, so expect that some of these are already in use):
Thanks again for your contributions! Even though we haven't been able to get this issue fixed, we hope you to report your findings and enhancement ideas in the future too! |
This issue is still valid for vaadin 7.7.13 |
Hello there! We are sorry that this issue hasn't progressed lately. We are prioritizing issues by severity and the number of customers we expect are experiencing this and haven't gotten around to fix this issue yet. There are a couple of things you could help to get things rolling on this issue (this is an automated message, so expect that some of these are already in use):
Thanks again for your contributions! Even though we haven't been able to get this issue fixed, we hope you to report your findings and enhancement ideas in the future too! |
The issue was automatically closed due to inactivity. If you found some new details to it or started working on it, comment on the issue so that maintainers can re-open it. |
Originally by @MTzukanov
When a modal window is open, pressing back in browser can change the url and the application state beyond the modal window.
Imported from https://dev.vaadin.com/ issue #12739
The text was updated successfully, but these errors were encountered: