flex-layout icon indicating copy to clipboard operation
flex-layout copied to clipboard

fxFlex choosing wrong overlapping breakpoint on initial load

Open TylerDev6 opened this issue 9 years ago • 7 comments

basically, <fxFlex="auto" fxFlex.gt-sm="33%" fxFlex.gt-md="50%" is choosing 33% even though gt-md qualifies.... only on initial page load.

Using 2.0.0-rc1. Behaviour is consistent across all browsers, and changing breakpoints corrects it.

TylerDev6 avatar Mar 10 '17 13:03 TylerDev6

On page load, the mediaQueries will announce possible activations in the following order gt-lg, gt-md, gt-sm, gt-xs. If both breakpoints qualify , the small (gt-sm) should show/activate; since gt-sm activates last; and has a greater range than gt-md.

Closing as "works as expected"

ThomasBurleson avatar Mar 11 '17 03:03 ThomasBurleson

Hmm, ok, so you're saying I need to change my targeting then?

TylerDev6 avatar Mar 11 '17 03:03 TylerDev6

Perhaps you should provide a code Plunkr and explain your objectives/needs. But let's do that on the Forum.

ThomasBurleson avatar Mar 11 '17 03:03 ThomasBurleson

My approach has been "mobile first", so fxFlex="auto" is the setting I wish for my smallest viewport. I was then expecting it to expand as space allowed.

If the observable announces changes in reverse order, then I just need to reverse my approach, using fxFlex for my largest viewport and switching to lt- aliases instead.

TylerDev6 avatar Mar 11 '17 03:03 TylerDev6

Currently with @angular/flex-layout supports the following default breakpoint aliases:

  • xl, lg, md, sm, xs,
  • gt-xl, gt-lg, gt-md, gt-sm , gt-xs,

With release 2.0.0-rc.2, we will also have the following aliases:

  • lt-xl, lt-lg, lt-md, lt-sm,

ThomasBurleson avatar Mar 11 '17 13:03 ThomasBurleson

that's perfect, thanks!

TylerDev6 avatar Mar 11 '17 18:03 TylerDev6

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.