@@ -43,12 +43,9 @@ import {
43
43
} from '@angular/material/form-field' ;
44
44
import { By } from '@angular/platform-browser' ;
45
45
import { BrowserAnimationsModule } from '@angular/platform-browser/animations' ;
46
- import { MatStepperModule } from '@angular/material/stepper' ;
47
- import { MatTabsModule } from '@angular/material/tabs' ;
48
46
import { Directionality , Direction } from '@angular/cdk/bidi' ;
49
47
import { Subject } from 'rxjs' ;
50
48
import { MatInputModule , MatInput , MAT_INPUT_VALUE_ACCESSOR } from './index' ;
51
- import { MatTextareaAutosize } from './autosize' ;
52
49
53
50
describe ( 'MatInput without forms' , ( ) => {
54
51
it ( 'should default to floating labels' , fakeAsync ( ( ) => {
@@ -1703,44 +1700,6 @@ describe('MatFormField default options', () => {
1703
1700
1704
1701
} ) ;
1705
1702
1706
- describe ( 'MatInput with textarea autosize' , ( ) => {
1707
- it ( 'should adjust height due to long placeholders' , ( ) => {
1708
- const fixture = createComponent ( AutosizeTextareaWithLongPlaceholder ) ;
1709
- fixture . detectChanges ( ) ;
1710
-
1711
- const textarea = fixture . nativeElement . querySelector ( 'textarea' ) ;
1712
- const autosize = fixture . componentInstance . autosize ;
1713
-
1714
- autosize . resizeToFitContent ( true ) ;
1715
-
1716
- const heightWithLongPlaceholder = textarea . clientHeight ;
1717
-
1718
- fixture . componentInstance . placeholder = 'Short' ;
1719
- fixture . detectChanges ( ) ;
1720
-
1721
- autosize . resizeToFitContent ( true ) ;
1722
-
1723
- expect ( textarea . clientHeight )
1724
- . withContext ( 'Expected the textarea height to be shorter with a long placeholder.' )
1725
- . toBeLessThan ( heightWithLongPlaceholder ) ;
1726
- } ) ;
1727
-
1728
- it ( 'should work in a tab' , ( ) => {
1729
- const fixture = createComponent ( AutosizeTextareaInATab , [ ] , [ MatTabsModule ] ) ;
1730
- fixture . detectChanges ( ) ;
1731
- const textarea = fixture . nativeElement . querySelector ( 'textarea' ) ;
1732
- expect ( textarea . getBoundingClientRect ( ) . height ) . toBeGreaterThan ( 1 ) ;
1733
- } ) ;
1734
-
1735
- it ( 'should work in a step' , ( ) => {
1736
- const fixture = createComponent ( AutosizeTextareaInAStep , [ ] , [ MatStepperModule ] ) ;
1737
- fixture . detectChanges ( ) ;
1738
- const textarea = fixture . nativeElement . querySelector ( 'textarea' ) ;
1739
- expect ( textarea . getBoundingClientRect ( ) . height ) . toBeGreaterThan ( 1 ) ;
1740
- } ) ;
1741
- } ) ;
1742
-
1743
-
1744
1703
function createComponent < T > ( component : Type < T > ,
1745
1704
providers : Provider [ ] = [ ] ,
1746
1705
imports : any [ ] = [ ] ,
@@ -2182,57 +2141,6 @@ class MatInputWithOutlineAppearanceInShadowDOM {
2182
2141
@ViewChild ( 'formField' , { read : ElementRef } ) formField : ElementRef < HTMLElement > ;
2183
2142
}
2184
2143
2185
-
2186
- // Styles to reset padding and border to make measurement comparisons easier.
2187
- const textareaStyleReset = `
2188
- textarea {
2189
- padding: 0;
2190
- border: none;
2191
- overflow: auto;
2192
- }` ;
2193
-
2194
- @Component ( {
2195
- template : `
2196
- <mat-form-field style="width: 100px" appearance="fill">
2197
- <textarea matInput matTextareaAutosize [placeholder]="placeholder"></textarea>
2198
- </mat-form-field>` ,
2199
- styles : [ textareaStyleReset ] ,
2200
- } )
2201
- class AutosizeTextareaWithLongPlaceholder {
2202
- placeholder = 'Long Long Long Long Long Long Long Long Placeholder' ;
2203
- @ViewChild ( MatTextareaAutosize ) autosize : MatTextareaAutosize ;
2204
- }
2205
-
2206
- @Component ( {
2207
- template : `
2208
- <mat-tab-group>
2209
- <mat-tab label="Tab 1">
2210
- <mat-form-field>
2211
- <textarea matInput matTextareaAutosize>
2212
- Blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
2213
- </textarea>
2214
- </mat-form-field>
2215
- </mat-tab>
2216
- </mat-tab-group>
2217
- `
2218
- } )
2219
- class AutosizeTextareaInATab { }
2220
-
2221
- @Component ( {
2222
- template : `
2223
- <mat-stepper>
2224
- <mat-step label="Step 1">
2225
- <mat-form-field>
2226
- <textarea matInput matTextareaAautosize>
2227
- Blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
2228
- </textarea>
2229
- </mat-form-field>
2230
- </mat-step>
2231
- </mat-stepper>
2232
- `
2233
- } )
2234
- class AutosizeTextareaInAStep { }
2235
-
2236
2144
@Component ( {
2237
2145
template : `
2238
2146
<mat-form-field>
0 commit comments