-
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(input): horizontal overflow in IE and Edge #2784
Conversation
Currently input labels are set to 133% width and are scaled down to fit into their container. This works fine in most browsers, however it causes horizontal overflows on IE and Edge, because they don't consider the `transform` when determining whether an element overflows. This change fixes it by hiding all of the overflowing content.
In most cases this will be fine, but users are allowed to put custom content inside the md-input-container and if they try to put some absolutely positioned thing that intentionally overflows, this would clip it. Could we instead put a wrapper around the label and just clip that? |
That should work as well. I'll give it a try. |
If it's just a div with This approach may be the simplest one without a lot of refactoring. |
@jelbourn how do you feel about this? |
@crisbeto Just to make sure I'm looking at the same bug, are you referring to the fact that when it's animating the placeholder overflows? because it looks like after it finishes animating its not a problem. how do you feel about this as an alternate solution? master...mmalerba:input-overflow |
That works pretty well @mmalerba, although I'm not a huge fan of the |
# Conflicts: # src/lib/input/input.scss
@mmalerba I re-did it, based on your changes. I worked around the |
|
||
// Keeps the element height since the placeholder text is `position: absolute`. | ||
&::after { | ||
content: '\\00a0'; |
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 wonder if its worth making this a separate class, seems potentially useful in other circumstances e.g. cdk-no-collapse
or something
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.
Hmm, not sure about it. In this case it's useful, but in others where there may be content in the element, it may end up pushing it.
@crisbeto Can you rebase? |
# Conflicts: # src/lib/input/input-container.html
# Conflicts: # src/lib/input/input-container.html
@crisbeto Rebase again? Sorry |
# Conflicts: # src/lib/input/input-container.html
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Currently input labels are set to 133% width and are scaled down to fit into their container. This works fine in most browsers, however it causes horizontal overflows on IE and Edge, because they don't consider the
transform
when determining whether an element overflows. This change fixes it by hiding all of the overflowing content.@mmalerba I didn't notice any issues when going through the input container demo page, but do you think that this may have some unexpected side-effects?