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

fxShow/fxHide breaks alignment

Open jt-helsinki opened this issue 9 years ago • 5 comments

Hi,

When adding fxShow/FxHide to my <div>, the fxLayoutAlign alignment is no longer recognised. This can be easily replicated in the plunkr demo for this project. Fiddling around with various combinations make this easy to replicate.

  • "@angular/flex-layout": "^2.0.0-beta.5"

If this is not a bug, would it be possible to provide an example? My understanding of the documentation is that I should be using <fxFlexAlign> for aligning the contents however that makes no difference either way.

Many thanks

Works as intended:

     <div fxLayout="row" fxFlex="grow" fxLayoutAlign="start center">
            <div fxFlex="200px" fxLayoutAlign="start center">
                Start Alignment
            </div>
            <!-- responsive menu -->
            <div fxFlex="grow" fxLayoutAlign="end center">
                End Alignment
            </div>
    </div>

Does NOT work:

     <div fxLayout="row" fxFlex="grow" fxLayoutAlign="start center">
            <div fxFlex="200px" fxLayoutAlign="start center">
                Start Alignment
            </div>
            <!-- responsive menu -->
            <div fxFlex="grow" fxLayoutAlign="end center" fxShow fxHide.gt-sm>
                End Alignment
            </div>
    </div>

jt-helsinki avatar Feb 16 '17 08:02 jt-helsinki

In my case, i can fix by setting fxLayoutAlign outside and put another div inside then use fxShow or fxHide with it.

Another solution:

<div fxLayout="row" fxLayoutAlign="center center">
    <div fxHide="false" fxHide.xs>This is center.</div>
</div>

i2egular avatar Feb 16 '17 08:02 i2egular

@i2egular thanks for that. Unfortunately, although this may work it creates a redundant div in the middle.

jt-helsinki avatar Feb 16 '17 09:02 jt-helsinki

@paistipoikka - Recently a community developer (thx to @ phil294) discovered that dual usages of fxShow + fxHide on the same element often do not working properly.

This has been fixed in PR #190.

Meanwhile, can you provide a Plunkr to validate that 190 fixes your issue ^?

ThomasBurleson avatar Feb 20 '17 23:02 ThomasBurleson

Fixed with SHA eee20b2

ThomasBurleson avatar Feb 21 '17 20:02 ThomasBurleson

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.