-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
fix(tabs): content animation in RTL not working (chrome) #12215
Merged
josephperrott
merged 1 commit into
angular:master
from
devversion:fix/tabs-animation-rtl-chrome
Jul 17, 2018
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do this directly in the stylesheet? I think we have a class for the off-screen tabs which should allow us to set the
min-height
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only have a class for the
active
tab body, so we could work with:not
, but since this technically belongs to the animation setup I'd anyway prefer having this here.That way if someone looks for the animations, he can quickly see that there is some special workaround applied.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, but this makes it a lot more difficult for somebody to change the
min-height
, if they wanted to.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That
min-height
is only temporarily while the tab is hidden. As soon as it transitions to the visible state, themin-height
is completely gone.Also, why would someone need to update the temporary
min-height
of an internal and hidden element? The developer can still set his ownmin-height
in the projected content easily.I'm fine changing if you really want to. Just think if we move into some SCSS file, we'd need some special selector (e.g.
:not
), and at some point we would not remember about that specific workaround that belongs to the animation.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way I'm viewing it is that it's unlikely for somebody to want to change the
min-height
, but if they do, it would be very hard for them to do so, whereas it's very low-effort for us to have it in the stylesheet to begin with. Having it there also ends up being less generated code.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see your point with the low-effort to place in the stylesheet. In regards to the code size, I think the generated CSS will take up more space than how it's right now.
Also, if we consider it like that, we could also argue about moving the actual
transform
's that don't include any computed values to the stylesheet.Anyway, I will switch it to the CSS but keep a comment that mentions the Chrome workaround that is placed in the stylesheet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed on Slack; since depending on the
.mat-tab-body-active
does not work because the class is being added before hidden tabs start the actual animation, we are keeping the workaround in the TS file.