Skip to content

Commit 0aaeb69

Browse files
devversionkara
authored andcommitted
chore(input): remove align input binding (#5141)
BREAKING CHANGE: The `align` input from the `<md-input-container>` component has been removed. Developers instead should use plain CSS to achieve the same effect (using `text-align: end` for example). Fixes #5140.
1 parent fdd5375 commit 0aaeb69

File tree

5 files changed

+8
-15
lines changed

5 files changed

+8
-15
lines changed

src/demo-app/input/input-demo.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ <h4>Inside a form</h4>
101101
<md-toolbar color="primary">Prefix + Suffix</md-toolbar>
102102
<md-card-content>
103103
<h4>Text</h4>
104-
<md-input-container align="end">
104+
<md-input-container class="demo-text-align-end">
105105
<input mdInput placeholder="amount">
106106
<span mdPrefix>$&nbsp;</span>
107107
<span mdSuffix>.00</span>
@@ -301,13 +301,13 @@ <h4>Textarea</h4>
301301
<input mdInput placeholder="Prefixed" value="example">
302302
<div mdPrefix>Example:&nbsp;</div>
303303
</md-input-container>
304-
<md-input-container align="end">
304+
<md-input-container class="demo-text-align-end">
305305
<input mdInput placeholder="Suffixed" value="123">
306306
<span mdSuffix>.00 €</span>
307307
</md-input-container>
308308
<br/>
309309
Both:
310-
<md-input-container align="end">
310+
<md-input-container class="demo-text-align-end">
311311
<input mdInput #email placeholder="Email Address" value="angular-core">
312312
<span mdPrefix><md-icon [class.primary]="email.focused">email</md-icon>&nbsp;</span>
313313
<span mdSuffix [class.primary]="email.focused">&nbsp;@gmail.com</span>

src/demo-app/input/input-demo.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
margin: 16px;
1313
}
1414

15+
.demo-text-align-end {
16+
text-align: end;
17+
}
18+
1519
.demo-textarea {
1620
resize: none;
1721
border: none;

src/lib/input/input-container.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<ng-content select="[mdPrefix], [matPrefix]"></ng-content>
55
</div>
66

7-
<div class="mat-input-infix" [class.mat-end]="align == 'end'">
7+
<div class="mat-input-infix">
88
<ng-content selector="input, textarea"></ng-content>
99

1010
<span class="mat-input-placeholder-wrapper">

src/lib/input/input-container.scss

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,6 @@ $mat-input-underline-height: 1px !default;
8888
// Needed to make last line of the textarea line up with the baseline.
8989
vertical-align: bottom;
9090

91-
.mat-end & {
92-
text-align: right;
93-
94-
[dir='rtl'] & {
95-
text-align: left;
96-
}
97-
}
98-
9991
// Undo the red box-shadow glow added by Firefox on invalid inputs.
10092
// See https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-ui-invalid
10193
&:-moz-ui-invalid {

src/lib/input/input-container.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,6 @@ export class MdInputDirective {
324324
export class MdInputContainer implements AfterViewInit, AfterContentInit, AfterContentChecked {
325325
private _placeholderOptions: PlaceholderOptions;
326326

327-
/** Alignment of the input container's content. */
328-
@Input() align: 'start' | 'end' = 'start';
329-
330327
/** Color of the input divider, based on the theme. */
331328
@Input() color: 'primary' | 'accent' | 'warn' = 'primary';
332329

0 commit comments

Comments
 (0)