Created
February 10, 2019 21:01
-
-
Save Bengejd/b191ca75f92beb50d1d0e009e80899e1 to your computer and use it in GitHub Desktop.
Push the screen up from the bottom, while maintaining a correct list order. Meant for chat pages mostly.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin pushFromBottom() { | |
overflow: auto; | |
display: flex; | |
flex-direction: column-reverse; | |
} | |
... | |
.push-from-bottom-container { | |
@include pushFromBottom(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="push-from-bottom-container"> <!-- This is the class that 'tricks' the html to think it's in reverse --> | |
<div class="message-container"> <!-- This undo's the reverse trick we played, and orders the messages correctly --> | |
<messages *ngFor="let m of messages"></messages> <!-- This is the message list that we're wanting to have properly order, but push from bottom. --> | |
</div> | |
</div |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment