Skip to content

Commit 5a91dbd

Browse files
authored
fix(datetime): add temporary workaround for datetime-ready logic issue on Ionic theme. (#30841)
Issue number: internal --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> Although the work done on [FW-6931](https://outsystemsrd.atlassian.net/browse/FW-6931), there was still a scenario on MobileUI, inside the ion-modal, where the datetime would disappear. This seems to only happen on iOS 26+, as we were not able to replicate it on version 18.* ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> As there's already task to better fix this issue across all themes, this PR introduces a small css backdoor, to be able to override the opacity value when necessary. This was done on ionic theme only and the css was split, to have no impact on md and iOS. * In `datetime.ionic.scss`, opacity is now controlled via CSS variables (`--body-opacity`, `--year-opacity`) for `.calendar-body` and `.datetime-year`. * In `datetime.native.scss`, explicit opacity rules for `.calendar-body` and `.datetime-year` are added, with visibility toggled based on the `.datetime-ready` class. * In `datetime.common.scss`, redundant and hard-coded opacity rules for `.calendar-body` and `.datetime-year` are removed, deferring control to theme-specific stylesheets. A small fix was also done on IonHeader token used for the border-color, to correctly reflect the value from Figma. ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer for more information. --> [FW-6931]: https://outsystemsrd.atlassian.net/browse/FW-6931?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
1 parent 9555a2a commit 5a91dbd

File tree

4 files changed

+41
-12
lines changed

4 files changed

+41
-12
lines changed

core/src/components/datetime/datetime.common.scss

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,13 @@
2525
width: 100%;
2626
}
2727

28-
:host .calendar-body,
29-
:host .datetime-year {
30-
opacity: 0;
31-
}
32-
3328
:host(:not(.datetime-ready)) .datetime-year {
3429
position: absolute;
3530
pointer-events: none;
3631
}
3732

38-
:host(.datetime-ready) .calendar-body {
39-
opacity: 1;
40-
}
41-
4233
:host(.datetime-ready) .datetime-year {
4334
display: none;
44-
45-
opacity: 1;
4635
}
4736

4837
/**

core/src/components/datetime/datetime.ionic.scss

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,30 @@
1212
--background: #{globals.$ion-bg-surface-default};
1313
--focus-ring-color: #{globals.$ion-border-focus-default};
1414
--focus-ring-width: #{globals.$ion-border-radius-025};
15+
/**
16+
* TODO(FW-6931): Remove these variables upon solving the root cause
17+
*/
18+
--body-opacity: 0;
19+
--year-opacity: 0;
20+
}
21+
22+
/**
23+
* TODO(FW-6931): Remove all this css related to opacity upon solving the root cause
24+
*/
25+
:host .calendar-body {
26+
opacity: var(--body-opacity);
27+
}
28+
29+
:host .datetime-year {
30+
opacity: var(--year-opacity);
31+
}
32+
33+
:host(.datetime-ready) .calendar-body {
34+
--body-opacity: 1;
35+
}
36+
37+
:host(.datetime-ready) .datetime-year {
38+
--year-opacity: 1;
1539
}
1640

1741
// Header

core/src/components/datetime/datetime.native.scss

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,22 @@
2323
max-width: 350px;
2424
}
2525

26+
/**
27+
* TODO(FW-6931): Move this back to common file upon solving the root cause
28+
*/
29+
:host .calendar-body,
30+
:host .datetime-year {
31+
opacity: 0;
32+
}
33+
34+
/**
35+
* TODO(FW-6931): Move this back to common file upon solving the root cause
36+
*/
37+
:host(.datetime-ready) .calendar-body,
38+
:host(.datetime-ready) .datetime-year {
39+
opacity: 1;
40+
}
41+
2642
/**
2743
* This ensures that the picker is appropriately
2844
* sized and never truncates the text.

core/src/components/header/header.ionic.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ion-header {
88
z-index: 10; // TODO(ROU-10853): replace this value with a layer token.
99

1010
&.header-divider {
11-
border-bottom: globals.$ion-border-size-025 globals.$ion-border-style-solid globals.$ion-primitives-neutral-300;
11+
border-bottom: globals.$ion-border-size-025 globals.$ion-border-style-solid globals.$ion-border-default;
1212
}
1313
}
1414

0 commit comments

Comments
 (0)