File tree 5 files changed +24
-3
lines changed
5 files changed +24
-3
lines changed Original file line number Diff line number Diff line change 8
8
9
9
<input id =" {{ _id }} -inner"
10
10
class =" ui5-input-inner"
11
+ style =" {{ styles.innerInput }} "
11
12
type =" {{ inputType }} "
12
13
inner-input
13
14
?inner-input-with-icon =" {{ icon.length }} "
Original file line number Diff line number Diff line change @@ -939,7 +939,11 @@ class Input extends UI5Element {
939
939
* @protected
940
940
*/
941
941
get nativeInput ( ) {
942
- return this . getDomRef ( ) . querySelector ( `input` ) ;
942
+ return this . getDomRef ( ) && this . getDomRef ( ) . querySelector ( `input` ) ;
943
+ }
944
+
945
+ get nativeInputWidth ( ) {
946
+ return this . nativeInput && this . nativeInput . offsetWidth ;
943
947
}
944
948
945
949
getLabelableElementId ( ) {
@@ -1114,6 +1118,9 @@ class Input extends UI5Element {
1114
1118
suggestionsPopover : {
1115
1119
"max-width" : `${ this . _inputWidth } px` ,
1116
1120
} ,
1121
+ innerInput : {
1122
+ padding : this . nativeInputWidth < 48 ? "0" : undefined ,
1123
+ } ,
1117
1124
} ;
1118
1125
}
1119
1126
Original file line number Diff line number Diff line change 15
15
16
16
: host .ui5-date-picker-input {
17
17
width : 100% ;
18
- min-width : inherit ;
18
+ min-width : 12.5625 rem ;
19
19
color : inherit;
20
20
background-color : inherit;
21
21
line-height : inherit;
Original file line number Diff line number Diff line change 19
19
line-height: normal;
20
20
letter- spacing: normal;
21
21
wor d- spacing: normal;
22
+ text- align: start;
22
23
}
23
24
24
25
: host ([focused]) {
58
59
-moz-appearance : textfield;
59
60
padding : var (--_ui5_input_inner_padding );
60
61
box-sizing : border-box;
61
- min-width : 3rem ;
62
+ min-width : inherit;
63
+ width : 100% ;
64
+ text-align : inherit;
62
65
text-overflow : ellipsis;
63
66
flex : 1 ;
64
67
outline : none;
Original file line number Diff line number Diff line change @@ -307,6 +307,16 @@ <h3>Input in a Dialog</h3>
307
307
</ ui5-input >
308
308
</ ui5-dialog >
309
309
310
+ < h3 > Short Input With Centered Text</ h3 >
311
+ < ui5-input class ="short " value ="244 "> </ ui5-input >
312
+ < style >
313
+ .short {
314
+ width : 2.5rem ;
315
+ min-width : 2.5rem ;
316
+ text-align : center;
317
+ }
318
+ </ style >
319
+
310
320
< script >
311
321
btnOpenDialog . addEventListener ( "click" , function ( ) {
312
322
dialog . open ( ) ;
You can’t perform that action at this time.
0 commit comments