Skip to content

bug(BreakpointObserver): BreakpointObserver is either not performant enough or implementation is problematic #27747

Open
@omerman

Description

@omerman

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

When using BreakpointObserver to set behaviors(props/style) to components it will often flicker on first reload especially once the window loads for the first time / when using ssr.

It is clear that using media queries for example will look perfect vs using BreakpointObserver to achieve the same things.

Is there a plan to deal with that?

Thank you so much

(If it looks like Im coming too strong, it's because it is frustrating, but really I do appreciate the hard work given on this framework)

Reproduction

  1. generate this example on an angular project ng generate @angular/material:navigation <component-name>
  2. open browser with 400px size(width)
  3. refresh the example

Expected Behavior

If you hide/show the relevant components using media query, it will just work. no flicker.

I would expect it to just work smoothly, and if it's a caveat I would expect some sort of implemented behavior/way to help us overcome this.

Actual Behavior

You will see the component of the sidenav flicker for a second.
Also the simple nav button will flicker

Environment

  • Angular: latest
  • CDK/Material: latest
  • Browser(s): chrome latest
  • Operating System (e.g. Windows, macOS, Ubuntu): mac

Metadata

Metadata

Assignees

No one assigned

    Labels

    P5The team acknowledges the request but does not plan to address it, it remains open for discussioncannot reproduceThe team is unable to reproduce this issue with the information providedneeds: clarificationThe issue does not contain enough information for the team to determine if it is a real bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions