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

feat: add colspan support to dashboard #7657

Merged
merged 2 commits into from
Aug 16, 2024

Conversation

tomivirkki
Copy link
Member

@tomivirkki tomivirkki commented Aug 16, 2024

Description

Add column spanning support for <vaadin-dashboard-layout>

  • Items can span multiple columns
  • Actual column span is capped to currently available columns
Kapture.2024-08-16.at.09.33.16.mp4

Added API:
--vaadin-dashboard-item-colspan: Applied to a child element of a dashboard layout. Affects its column span in the layout grid.

Fixes https://github.com/orgs/vaadin/projects/70/views/1?pane=issue&itemId=74625129

Part of vaadin/platform#6626

Type of change

Feature

Copy link

sonarcloud bot commented Aug 16, 2024

*/
__updateItemMaxColspan() {
// Temporarily set max colspan to 1
this.style.setProperty('--_vaadin-dashboard-item-max-colspan', 1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to cause flickering when resizing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screen.Recording.2024-08-16.at.12.48.39.mov

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, a ResizeObserver isn't synchronous (and there is no CSS-only way to implement the colspan capping). We can later try to improve this by, for example, wrapping the content inside another container that we manually resize to match the host's size.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added an issue for this to the ideas column.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrapping the content inside another container that we manually resize to match the host's size

Did a quick prototype of this here https://github.com/vaadin/web-components/tree/proto/dashboard-container and it does eliminate the flickering

@tomivirkki tomivirkki merged commit e0a2f54 into feat/dashboard Aug 16, 2024
9 checks passed
@tomivirkki tomivirkki deleted the feat/dashboard-colspan branch August 16, 2024 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants