Skip to content

Commit eb18c32

Browse files
authored
fix(ui5-date-picker, ui5-time-picker): adjust styles (#11704)
- `ui5-time-picker` now has the correct hover background for the readonly and all value-states - `ui5-date-picker` and the other date & time picker components now have the correct disabled opacity Fixes: #11605 Fixes: #11609
1 parent 5a9ebdf commit eb18c32

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

packages/main/src/themes/DatePicker.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@
5151
margin: inherit;
5252
}
5353

54+
:host([disabled]) .ui5-date-picker-input {
55+
background-color: var(--_ui5-input_disabled_background);
56+
opacity: var(--_ui5_input_disabled_opacity);
57+
}
58+
5459
:host(:not([disabled]):not([readonly])) .ui5-date-picker-input[focused] {
5560
background-color: var(--_ui5-datepicker-hover-background);
5661
}

packages/main/src/themes/InputSharedStyles.css

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,18 @@
44
- readonly and disabled states
55
*/
66

7+
:host([disabled]) {
8+
cursor: default;
9+
pointer-events: none;
10+
background: none;
11+
}
12+
713
:host([readonly]:not([disabled])) {
814
border-color: var(--_ui5_input_readonly_border_color);
915
background: var(--sapField_ReadOnly_BackgroundStyle);
1016
background-color: var(--_ui5_input_readonly_background);
1117
}
1218

13-
:host([disabled]) {
14-
opacity: var(--_ui5_input_disabled_opacity);
15-
cursor: default;
16-
pointer-events: none;
17-
background-color: var(--_ui5-input_disabled_background);
18-
border-color: var(--_ui5_input_disabled_border_color);
19-
}
20-
2119
:host([value-state="Negative"]) .inputIcon:not(.inputIcon--pressed):not(:active):hover {
2220
box-shadow: var(--_ui5_input_error_icon_box_shadow);
2321
}

packages/main/src/themes/TimePicker.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
background-color: var(--sapField_InvalidBackground);
2828
}
2929

30-
:host(:not([disabled]):hover) {
30+
:host(:not([disabled]):not([readonly]):hover) {
3131
background: var(--sapField_Hover_Background);
3232
}
3333

@@ -49,6 +49,11 @@
4949
height: inherit;
5050
}
5151

52+
:host([disabled]) .ui5-time-picker-input {
53+
background-color: var(--_ui5-input_disabled_background);
54+
opacity: var(--_ui5_input_disabled_opacity);
55+
}
56+
5257
.ui5-time-picker-popover::part(header) {
5358
padding: 0;
5459
}

packages/main/test/pages/TimePicker.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ <h3>TimePicker in Compact</h3>
9090
<div slot="valueStateMessage" id="customValueStateMessageInformation">Additional information</div>
9191
</ui5-time-picker>
9292

93+
<ui5-time-picker readonly></ui5-time-picker>
94+
<ui5-time-picker disabled></ui5-time-picker>
95+
9396
<script>
9497
var counter = 0;
9598
timepickerChange.addEventListener("ui5-change", function() {

0 commit comments

Comments
 (0)