Skip to content

Commit 37b7891

Browse files
authored
fix(ui5-select): fix component baseline alignment (#1075)
FIXES: #1074 **Background** The `overflow: hidden` causes the ui5-select to be pushed upwards the main baseline (as described in the issue). Originally, the style was introduced not to allow the hover of the arrow to cover the input border. Now, this is resolved by moving this `overflow: hidden` to inner element and in the same time not disrupting the baseline alignment of the whole component.
1 parent f5993b9 commit 37b7891

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed

packages/main/src/themes/Select.css

+1-6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
display: flex;
88
outline: none;
99
cursor: pointer;
10+
overflow: hidden;
1011
}
1112

1213
.ui5-select-label-root {
@@ -29,10 +30,4 @@
2930

3031
:host(:not([disabled])) {
3132
cursor: pointer;
32-
}
33-
34-
:host([value-state="Error"]),
35-
:host([value-state="Warning"]),
36-
:host([value-state="Success"]) {
37-
overflow: hidden;
3833
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
:root {
2-
--_ui5-input-icon-padding: .56275rem .6875rem;
2+
--_ui5-input-icon-padding: .5625rem .6875rem;
33
}

packages/main/test/pages/Input.html

+23-3
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,34 @@ <h3> Input type 'Tel'</h3>
9090
<h3> Input type 'URL'</h3>
9191
<ui5-input id="input-url" style="width:100%" type="URL"></ui5-input>
9292

93-
<h3> Input and button and select</h3>
93+
<h3> Inputs alignment</h3>
9494
<ui5-button>Press</ui5-button>
95-
<ui5-input style="width: 10rem;" value="input"></ui5-input>
96-
<ui5-select id="mySelect2"style="width: 10rem;">
95+
<ui5-datepicker style="width: 6rem;" id='dp5'
96+
placeholder='Delivery Date...'
97+
title='Delivery Date!'>
98+
</ui5-datepicker>
99+
100+
<ui5-datepicker style="width: 6rem;" id='dp5'
101+
placeholder='Delivery Date...'
102+
value-state="Error"
103+
title='Delivery Date!'>
104+
</ui5-datepicker>
105+
106+
<ui5-select id="mySelect2"style="width: 6rem;">
97107
<ui5-option>Cozy</ui5-option>
98108
<ui5-option selected>Compact</ui5-option>
99109
<ui5-option>Condensed</ui5-option>
100110
</ui5-select>
111+
112+
<ui5-input style="width: 6rem;" value="input" value-state="Error">
113+
<ui5-icon slot="icon" name="message-warning"></ui5-icon>
114+
</ui5-input>
115+
<ui5-select id="mySelect2"style="width: 6rem;" value-state="Error">
116+
<ui5-option>Cozy</ui5-option>
117+
<ui5-option selected>Compact</ui5-option>
118+
<ui5-option>Condensed</ui5-option>
119+
</ui5-select>
120+
<ui5-multi-combobox value-state="Error" style="width: 6rem;"></ui5-multi-combobox>
101121

102122
<script>
103123
var sap_database_entries = [{ key: "Afg", text: "Afghanistan" }, { key: "Arg", text: "Argentina" }, { key: "Alb", text: "Albania" }, { key: "Arm", text: "Armenia" }, { key: "Alg", text: "Algeria" }, { key: "And", text: "Andorra" }, { key: "Ang", text: "Angola" }, { key: "Ast", text: "Austria" }, { key: "Aus", text: "Australia" }, { key: "Aze", text: "Azerbaijan" }, { key: "Aruba", text: "Aruba" }, { key: "Antigua", text: "Antigua and Barbuda" }, { key: "Bel", text: "Belarus" }, { key: "Bel", text: "Belgium" }, { key: "Bg", text: "Bulgaria" }, { key: "Bra", text: "Brazil" }, { key: "Ch", text: "China" }, { key: "Cub", text: "Cuba" }, { key: "Chil", text: "Chili" }, { key: "Lat", text: "Latvia" }, { key: "Lit", text: "Litva" }, { key: "Prt", text: "Portugal" }, { key: "Sen", text: "Senegal" }, { key: "Ser", text: "Serbia" }, { key: "Afg", text: "Seychelles" }, { key: "Sierra", text: "Sierra Leone" }, { key: "Sgp", text: "Singapore" }, { key: "Sint", text: "Sint Maarten" }, { key: "Slv", text: "Slovakia" }, { key: "Slo", text: "Slovenia" }];

0 commit comments

Comments
 (0)