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

EmptyState: Investigate ResizeObserver for proper layout handling #648

Closed
ffriedl89 opened this issue Feb 26, 2020 · 1 comment · Fixed by #654
Closed

EmptyState: Investigate ResizeObserver for proper layout handling #648

ffriedl89 opened this issue Feb 26, 2020 · 1 comment · Fixed by #654
Assignees
Labels
feature has-pr P2 Issue that is important to resolve as soon as possible

Comments

@ffriedl89
Copy link
Collaborator

Feature Request

Summary

As part of progressive enhancement, we should investigate the resizeobserver for the empty state component to get rid of the _updateLayout call. Make the component aware of it's container view (hello container queries)

Feature Description

The current problem we have is that the empty-state component is used in multiple parents and "extended" versions of the component by using the dtCustomEmptyState directive and we would need to handle _updateLayout for each scenario.
By using the resize observer we would transfer this logic into the empty state since the component itself is aware of the container's width.

Attachments

@ffriedl89 ffriedl89 added feature P2 Issue that is important to resolve as soon as possible labels Feb 26, 2020
@ffriedl89 ffriedl89 added this to To do in Barista components Feb 26, 2020
@tomheller tomheller self-assigned this Feb 27, 2020
@tomheller
Copy link
Collaborator

I will look into this one! First thing I noticed that typescript does not ship types for it within lib.dom because it is still marked as EditorsDraft in the spec. See issue microsoft/TypeScript#28502
That should be fixable by declaring it, but the typesaftey will be a bit off.

This is what we get back from the ResizeObserver, if we observe the container element of the DtEmptyState. This seems like we can work with that.
image

tomheller added a commit that referenced this issue Mar 2, 2020
tomheller added a commit that referenced this issue Mar 3, 2020
tomheller added a commit that referenced this issue Mar 3, 2020
Barista components automation moved this from To do to Done Mar 4, 2020
github-actions bot pushed a commit that referenced this issue Mar 4, 2020
yngrdyn pushed a commit to yngrdyn/barista that referenced this issue Nov 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature has-pr P2 Issue that is important to resolve as soon as possible
Projects
No open projects
2 participants