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

17.0.2 Grid in dialog column won't resize (moves entire dialog) [BUG] #190

Closed
dyachera opened this issue Sep 14, 2020 · 5 comments · Fixed by #191
Closed

17.0.2 Grid in dialog column won't resize (moves entire dialog) [BUG] #190

dyachera opened this issue Sep 14, 2020 · 5 comments · Fixed by #191
Labels

Comments

@dyachera
Copy link

I upgraded my application from 17.0.1 to 17.0.2 and noticed that all of my grids that were inside dialogs could no longer have their columns resized. When you try and resize instead of the column resizing the entire dialog window moves instead. For now I have downgraded back to 17.0.1 since this would be a major breaking point for the application, I will try and create a minimal example later today.

@ZheSun88
Copy link

Thanks for using Vaadin Platform, we appreciate your help and are going to take care of this as soon as possible.

@web-padawan web-padawan transferred this issue from vaadin/platform Sep 14, 2020
@web-padawan
Copy link
Member

Appears to be a regression from #188

@tomivirkki
Copy link
Member

Are you by any chance using a class name generator that adds the class name "draggable" to your grid? After the change linked above, draggable dialogs consider any elements with class name "draggable" as dialog drag handles.

@dyachera
Copy link
Author

I use the method setDraggable(true) when creating the dialogs, nothing custom. Min example:

		Dialog dialog = new Dialog();
		Grid<Boolean> grid = new Grid<Boolean>(Boolean.class);
		grid.addColumn(bool -> bool.toString()).setHeader("1").setKey("1");
		grid.addColumn(bool -> bool.hashCode()).setHeader("2").setKey("2");
		grid.getColumns().forEach(col -> col.setResizable(true));
		grid.setItems(Boolean.FALSE);
		dialog.add(grid);
		dialog.setDraggable(true);
		dialog.setSizeFull();
		dialog.open();

When trying to resize the columns in the above it moves entire dialog. I'm guessing setDraggable does add the class you mentioned, but I want the dialog to be able to be moved in addition for columns to be resized

@tomivirkki
Copy link
Member

Ah, right, the class name is being picked up from the container element. So this is actually a regression.

Temporary workaround:

dialog.getElement().executeJs("this.$.overlay.querySelector('flow-component-renderer > div').classList.remove('draggable')");

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