Skip to content

Commit 0aa7207

Browse files
authored
Merge pull request #5028 from IgniteUI/fix-#4752-master
fix(input-group): japanese symbols get cut off in input and label
2 parents c864f73 + 783b7a0 commit 0aa7207

File tree

3 files changed

+45
-21
lines changed

3 files changed

+45
-21
lines changed

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

+8-18
Original file line numberDiff line numberDiff line change
@@ -505,26 +505,24 @@
505505
position: absolute;
506506
width: 100%;
507507
transform: translateY(50%); /* 8px, base is 16px */
508-
line-height: rem(16px, map-get($base-scale-size, 'comfortable')) !important;
509-
height: rem(18px, map-get($base-scale-size, 'comfortable'));
508+
line-height: 1 !important;
509+
height: rem(18px);
510510
backface-visibility: hidden;
511511
will-change: transform;
512512
transform-origin: top left;
513-
transition: transform $transition-timing, color $transition-timing;
513+
transition: transform $transition-timing, color $transition-timing, margin $transition-timing;
514514

515515
[dir='rtl'] & {
516516
transform-origin: top right;
517517
}
518518
}
519519

520520
%form-group-label--cosy {
521-
line-height: rem(16px, map-get($base-scale-size, 'cosy')) !important;
522-
height: rem(18px, map-get($base-scale-size, 'cosy'));
521+
margin-top: rem(-2px);
523522
}
524523

525524
%form-group-label--compact {
526-
line-height: rem(16px, map-get($base-scale-size, 'compact')) !important;
527-
height: rem(18px, map-get($base-scale-size, 'compact'));
525+
margin-top: rem(-4px);
528526
}
529527

530528
%form-group-label--box {
@@ -534,6 +532,7 @@
534532
%form-group-label--float {
535533
overflow: visible;
536534
transform: translateY(-50%) scale(.75);
535+
margin-top: auto;
537536
}
538537

539538
%form-group-label--fixed {
@@ -574,6 +573,8 @@
574573
color: --var($theme, 'filled-text-color');
575574
outline-style: none;
576575
box-shadow: none;
576+
border-top: rem(3px) solid transparent;
577+
padding-bottom: rem(3px);
577578

578579
&::-webkit-input-placeholder {
579580
line-height: normal;
@@ -886,17 +887,6 @@
886887
$input-text-props: igx-type-scale-category($type-scale, $input-text);
887888

888889
@include igx-scope('.igx-typography') {
889-
%form-group-label {
890-
@include igx-type-style($type-scale, $input-text) {
891-
// This is embarrassing but there's no other
892-
// way to extract the font-size the user sets
893-
// in case they use custom typography :(
894-
// We need the padding so that the text doesn't get
895-
// cut off.
896-
padding-bottom: map-get($input-text-props, 'font-size');
897-
}
898-
}
899-
900890
%form-group-input {
901891
@include igx-type-style($type-scale, $input-text) {
902892
margin: 0;

projects/igniteui-angular/src/lib/select/select-positioning-strategy.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export class SelectPositioningStrategy extends ConnectedPositioningStrategy impl
4848
}
4949

5050
private positionNoScroll(contentElement: HTMLElement, CURRENT_POSITION_Y: number) {
51-
contentElement.style.top = `${CURRENT_POSITION_Y - this.itemTextToInputTextDiff }px`;
51+
contentElement.style.top = `${CURRENT_POSITION_Y - this.itemTextToInputTextDiff}px`;
5252
this.deltaY = CURRENT_POSITION_Y -
5353
(this.select.input.nativeElement.getBoundingClientRect() as DOMRect).top - this.itemTextToInputTextDiff;
5454
}
@@ -197,7 +197,7 @@ export class SelectPositioningStrategy extends ConnectedPositioningStrategy impl
197197
if (currentScroll === 0) {
198198
this.positionNoScroll(contentElement, CURRENT_POSITION_Y);
199199
return;
200-
// (more than 5 items) and current scroll
200+
// (more than 5 items) and current scroll
201201
} else {
202202
this.positionAndScrollBottom(contentElement, OUT_OF_BOUNDS.Amount);
203203
return;

src/app/input-group/input-group-child.sample.html

+35-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,43 @@ <h3 class="sample-title">Line Style Input With Different Display Density</h3>
33
<!-- Basic text field -->
44
<igx-input-group>
55
<input igxInput name="firstName" type="text" [(ngModel)]="user.firstName" required />
6-
<label igxLabel for="firstName">Text Field</label>
6+
<label igxLabel for="firstName">日日日</label>
7+
<igx-prefix>
8+
<igx-icon>person</igx-icon>
9+
</igx-prefix>
710
</igx-input-group>
811

12+
<igx-input-group type="box">
13+
<input igxInput name="firstName" type="text" [(ngModel)]="user.firstName" required />
14+
<label igxLabel for="firstName">日日日</label>
15+
<igx-prefix>
16+
<igx-icon>person</igx-icon>
17+
</igx-prefix>
18+
</igx-input-group>
19+
20+
<igx-input-group type="border">
21+
<input igxInput name="firstName" type="text" [(ngModel)]="user.firstName" required />
22+
<label igxLabel for="firstName">日日日</label>
23+
<igx-prefix>
24+
<igx-icon>person</igx-icon>
25+
</igx-prefix>
26+
</igx-input-group>
27+
28+
<igx-input-group>
29+
<textarea igxInput name="firstName" type="text" [(ngModel)]="user.firstName" required></textarea>
30+
<label igxLabel for="firstName">日日日</label>
31+
<igx-prefix>
32+
<igx-icon>person</igx-icon>
33+
</igx-prefix>
34+
</igx-input-group>
35+
36+
<igx-input-group type="border">
37+
<textarea igxInput name="firstName" type="text" [(ngModel)]="user.firstName" required></textarea>
38+
<label igxLabel for="firstName">日日日</label>
39+
<igx-prefix>
40+
<igx-icon>person</igx-icon>
41+
</igx-prefix>
42+
</igx-input-group>
943
<!-- Basic text field w/ placeholder -->
1044
<igx-input-group>
1145
<label igxLabel>Label</label>

0 commit comments

Comments
 (0)