Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

fix(input): prevent the floating label from overflowing #8116

Closed
wants to merge 1 commit into from

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Apr 19, 2016

The calc that was used to truncate the long input labels was actually making them longer on IE.
This is because IE calculates whether to overflow an element before applying any of the transforms.

Closes #7403.

@EladBezalel can you take a look at this since it was introduced with fd46483.

@crisbeto crisbeto added needs: review This PR is waiting on review from the team needs: work and removed needs: review This PR is waiting on review from the team labels Apr 19, 2016
The calc that was used to truncate the long input labels was actually making them longer on IE.
This is because IE calculates whether to overflow an element before applying any of the transforms.

Closes angular#7403.
@crisbeto crisbeto force-pushed the floating-label-fix-2 branch from b8563b9 to c705f17 Compare April 19, 2016 20:48
@crisbeto crisbeto added needs: review This PR is waiting on review from the team and removed needs: work labels Apr 19, 2016
@crisbeto
Copy link
Member Author

I updated the PR to remove those calcs entirely. We can't depend on them in IE because it ignores the transform when determining whether to overflow the parent.

@EladBezalel
Copy link
Member

@crisbeto so the label isn't expanding?

@ThomasBurleson
Copy link
Contributor

@crisbeto - what about #5331

@ThomasBurleson ThomasBurleson added the in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs label Apr 20, 2016
@ThomasBurleson ThomasBurleson added this to the 1.1.1 milestone Apr 20, 2016
@crisbeto
Copy link
Member Author

@EladBezalel The label is expanding, but it's causing an overflow in IE/Edge.
@ThomasBurleson That will still work.

Here's the situation:
Right now, when the label starts "floating" it gets reduced to 75% of it's original size via scale(0.75). This gives us the extra 25% on the sides which we can use to expand the label a little more and show some more text. We do it by increasing the label width. This works fine in most browsers where the transform gets accounted for when determining whether to overflow the parent. On the other hand, IE/Edge determines whether to overflow the parent before any transformations are applied, which causes it to always overflow. Here's a fiddle with an example of the issue. Try focusing any of the input in IE or Edge and then some other browser.
I think we should avoid this behaviour altogether.

@ThomasBurleson ThomasBurleson modified the milestones: 1.1.1, Backlog Apr 21, 2016
@crisbeto crisbeto removed the in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs label Apr 25, 2016
@Splaktar Splaktar removed this from the - Backlog milestone Jun 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: review This PR is waiting on review from the team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants