-
Notifications
You must be signed in to change notification settings - Fork 3.4k
mdInputContainer: Has padding-left using .md-icon-right with only md-icon on the right side #6348
Comments
Using a class for right only is a little messy, IMO. The root issue, is that, because there is no md-icon-left class, the underlying logic looks for any icon (regardless of position), then adds the md-has-icon class, which in turn adds 36px of left padding to the parent and moves the label 36px from the left. Here are the broken selectors:
Possible solutions:1) Fix left padding: 2) Replace: Fix left padding |
The problem with this solution is that you can have either an |
I can't think of a use where you would need that, but if it is required, add a second (technically third, with "md-has-icon") class: "md-icon-both". The current styling is mis-classed. No extra class aligns the icon left with "md-has-icon", and "md-icon-right" adds room for two icons by default. The method in the codepen below allows for all three scenarios. edit |
It is used in the demo that way. Here they denote that the input is the amount of a donation with a gift icon and they denote the currency with the euro sign icon. |
The only reason the demo works, is because "md-icon-right" is technically broken, as proven by your first demo. |
I linked the demo to show that there is a use for it and that it probably should be supported. Fix works beautifully by the way. |
Hi, I still see same issue with 1.0.1, is this planned for a future release? Thanks |
- Fixed single icon on the right - Added smart classes applying, now the directive will automatically add md-icon-left/right according the icon placement (after/before the input) fixes #6348
- Fixed single icon on the right - Added smart classes applying, now the directive will automatically add md-icon-left/right according the icon placement (after/before the input) fixes #6348
- Fixed single icon on the right - Added smart classes applying, now the directive will automatically add md-icon-left/right according the icon placement (after/before the input) fixes #6348
- Fixed single icon on the right - Added smart classes applying, now the directive will automatically add md-icon-left/right according the icon placement (after/before the input) fixes angular#6348 Closes angular#6720
i have still the same issue in the latest 1.0.8 version. will this be fixed in 1.1 or anytime soon? |
I have same problem. My page is RTL so I think that's causing the problem. Any fix? |
@ttvd94 this was fixed in 1.0.4. What version are you using? Please open a new issue with a CodePen that demonstrates the issue. |
Version: 1.0.0
OS: Windows 10
Browser: Chrome 47
Right now
md-input-container
has a padding left if it has the class.md-icon-right
, even if the only icon present is on the right side.Example: http://codepen.io/anon/pen/wMMQde
you can see the top
md-input-container
is the entire width while the bottom one has apadding-left
. The third one has the fix below.This is easily fixed by adding a class like
md-icon-right-only
and using the following CSSThis removes the
padding-left
from themd-input-container
and repositions thelabel
accordingly.The text was updated successfully, but these errors were encountered: