Skip to content

Commit 282cc8a

Browse files
committed
refactor(textarea): remove min-height
1 parent 7d5252c commit 282cc8a

File tree

7 files changed

+41
-16
lines changed

7 files changed

+41
-16
lines changed

projects/igniteui-angular/src/lib/core/styles/components/date-range-picker/_date-range-picker-theme.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
}
2424
}
2525

26+
igx-date-range-start,
27+
igx-date-range-end {
28+
min-width: 0;
29+
}
30+
2631
igx-date-range-start,
2732
igx-date-range-end,
2833
%igx-date-range-picker__start,

projects/igniteui-angular/src/lib/core/styles/components/input/_input-group-theme.scss

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,6 +1200,18 @@
12001200
}
12011201

12021202
@if $variant == 'material' {
1203+
%textarea-group:not(%textarea-group--outlined) {
1204+
--textarea-box-padding: #{pad-block(rem(8px), rem(12px), rem(16px))};
1205+
1206+
&:has(%igx-input-group__notch:not(:empty)) {
1207+
--textarea-box-padding: #{pad-block(rem(16px), rem(20px), rem(24px))};
1208+
}
1209+
1210+
%form-group-textarea {
1211+
margin-block-end: rem(2px);
1212+
}
1213+
}
1214+
12031215
%textarea-group:not(%suffixed) {
12041216
%form-group-bundle-main {
12051217
grid-area: 1 / 2 / span 1 / span 3;
@@ -1240,9 +1252,6 @@
12401252
}
12411253

12421254
%form-group-textarea-group-bundle {
1243-
// 3 lines of text + top padding
1244-
--textarea-height: calc((#{$textarea-font} * 3) + #{$textarea-top-padding});
1245-
min-height: var(--textarea-height) !important;
12461255
height: auto !important;
12471256

12481257
%form-group-label {
@@ -1442,18 +1451,13 @@
14421451
}
14431452

14441453
%form-group-textarea {
1445-
--textarea-height: calc((#{$textarea-font} * 3) + #{$textarea-top-padding});
1446-
1447-
min-height: var(--textarea-height);
14481454
height: auto;
14491455
resize: vertical;
14501456
overflow: hidden;
14511457
z-index: 1;
14521458

14531459
@if $material-theme {
14541460
padding: 0;
1455-
// to be fixed
1456-
inset-block-start: rem(-2px);
14571461
}
14581462
}
14591463

@@ -1466,14 +1470,18 @@
14661470
}
14671471

14681472
@if $material-theme {
1469-
padding-block-start: #{$material-box-top-padding};
1473+
padding-block-start: var(--textarea-box-padding);
14701474
}
14711475
}
14721476

14731477
%textarea-group--outlined {
14741478
%form-group-textarea-group-bundle-main {
14751479
padding-block-start: #{$material-border-top-padding};
14761480
}
1481+
1482+
%form-group-textarea {
1483+
inset-block-start: rem(-2px);
1484+
}
14771485
}
14781486

14791487
%form-group-textarea--disabled {
@@ -1662,13 +1670,13 @@
16621670
position: relative;
16631671
}
16641672

1665-
// %form-group-helper-item--start {
1666-
// justify-content: flex-start;
1667-
// }
1673+
%form-group-helper-item--start {
1674+
justify-content: flex-start;
1675+
}
16681676

1669-
// %form-group-helper-item--end {
1670-
// justify-content: flex-end;
1671-
// }
1677+
%form-group-helper-item--end {
1678+
justify-content: flex-end;
1679+
}
16721680

16731681
%form-group-helper-item--start,
16741682
%form-group-helper-item--end {

projects/igniteui-angular/src/lib/core/styles/components/time-picker/_time-picker-theme.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
@include css-vars($theme, '.igx-time-picker');
99

1010
$variant: map.get($theme, '_meta', 'theme');
11-
$not-bootstrap-theme: $variant != 'bootstrap';
1211

1312
$picker-buttons-padding: map.get((
1413
'material': rem(8px),
@@ -24,6 +23,11 @@
2423
'indigo': rem(16px),
2524
), $variant);
2625

26+
.igx-input-group {
27+
display: flex;
28+
flex-direction: column;
29+
}
30+
2731
%time-picker-display {
2832
@include sizable();
2933

projects/igniteui-angular/src/lib/directives/input/input.directive.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,10 @@ export class IgxInputDirective implements AfterViewInit, OnDestroy {
301301
const elTag = this.nativeElement.tagName.toLowerCase();
302302
if (elTag === 'textarea') {
303303
this.isTextArea = true;
304+
305+
if (this.nativeElement.getAttribute('rows') === null) {
306+
this.renderer.setAttribute(this.nativeElement, 'rows', '3');
307+
}
304308
} else {
305309
this.isInput = true;
306310
}

src/app/date-picker/date-picker.sample.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ <h6>Angular Date Picker</h6>
1818
<igx-suffix (click)="dpAng.open()">
1919
<igx-icon>alarm</igx-icon>
2020
</igx-suffix>
21+
<span igxHint>Helper text</span>
2122
<ng-template igxPickerActions let-calendar>
2223
<button igxButton="flat" (click)="calendar.viewDate = today">
2324
Today

src/app/date-range/date-range.sample.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ <h6>Angular Date Range Picker, two inputs, template-driven form</h6>
4646
type="text"
4747
[placeholder]="properties.placeholder"
4848
/>
49+
<igx-hint>Helper text</igx-hint>
4950
</igx-date-range-start>
5051
<igx-date-range-end>
5152
<igx-picker-toggle igxPrefix>
@@ -61,6 +62,7 @@ <h6>Angular Date Range Picker, two inputs, template-driven form</h6>
6162
type="text"
6263
[placeholder]="properties.placeholder"
6364
/>
65+
<igx-hint>Helper text</igx-hint>
6466
</igx-date-range-end>
6567
</igx-date-range-picker>
6668
</div>

src/app/input-group-showcase/input-group-showcase.sample.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
display: flex;
5454
flex-direction: column;
5555
gap: 2rem;
56+
min-width: 0;
5657
}
5758

5859
.showcase__placeholder {

0 commit comments

Comments
 (0)