Skip to content

Commit 957604c

Browse files
authored
refactor(datetime): remove safari 14 hack (#29035)
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. --> This code was added to account for a Safari 14 issue that would cause datetime to render incorrectly. The Safari bug was fixed starting in Safari 15. However, Ionic v7 supported back to Safari 14. More context is available [here](#24421 (comment)) ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Removed the Safari 14 workarounds since Ionic v8 does not support Safari 14 I tested on iOS 15, 16, and 17 to verify that removing this hack does not cause any issues. Also verified that removing this hack does reproduce the issue on iOS 14 (to verify that I am reproducing the original issue correctly) ## 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/.github/CONTRIBUTING.md#footer for more information. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. -->
1 parent b37fa5e commit 957604c

File tree

1 file changed

+0
-48
lines changed

1 file changed

+0
-48
lines changed

core/src/components/datetime/datetime.tsx

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1662,14 +1662,6 @@ export class Datetime implements ComponentInterface {
16621662
disabled={disabled}
16631663
value={todayString}
16641664
onIonChange={(ev: CustomEvent) => {
1665-
// TODO(FW-1823) Remove this when iOS 14 support is dropped.
1666-
// Due to a Safari 14 issue we need to destroy
1667-
// the scroll listener before we update state
1668-
// and trigger a re-render.
1669-
if (this.destroyCalendarListener) {
1670-
this.destroyCalendarListener();
1671-
}
1672-
16731665
const { value } = ev.detail;
16741666
const findPart = parts.find(({ month, day, year }) => value === `${year}-${month}-${day}`);
16751667

@@ -1683,10 +1675,6 @@ export class Datetime implements ComponentInterface {
16831675
...findPart,
16841676
});
16851677

1686-
// We can re-attach the scroll listener after
1687-
// the working parts have been updated.
1688-
this.initializeCalendarListener();
1689-
16901678
ev.stopPropagation();
16911679
}}
16921680
>
@@ -1793,14 +1781,6 @@ export class Datetime implements ComponentInterface {
17931781
disabled={disabled}
17941782
value={pickerColumnValue}
17951783
onIonChange={(ev: CustomEvent) => {
1796-
// TODO(FW-1823) Remove this when iOS 14 support is dropped.
1797-
// Due to a Safari 14 issue we need to destroy
1798-
// the scroll listener before we update state
1799-
// and trigger a re-render.
1800-
if (this.destroyCalendarListener) {
1801-
this.destroyCalendarListener();
1802-
}
1803-
18041784
this.setWorkingParts({
18051785
...workingParts,
18061786
day: ev.detail.value,
@@ -1811,10 +1791,6 @@ export class Datetime implements ComponentInterface {
18111791
day: ev.detail.value,
18121792
});
18131793

1814-
// We can re-attach the scroll listener after
1815-
// the working parts have been updated.
1816-
this.initializeCalendarListener();
1817-
18181794
ev.stopPropagation();
18191795
}}
18201796
>
@@ -1848,14 +1824,6 @@ export class Datetime implements ComponentInterface {
18481824
disabled={disabled}
18491825
value={workingParts.month}
18501826
onIonChange={(ev: CustomEvent) => {
1851-
// TODO(FW-1823) Remove this when iOS 14 support is dropped.
1852-
// Due to a Safari 14 issue we need to destroy
1853-
// the scroll listener before we update state
1854-
// and trigger a re-render.
1855-
if (this.destroyCalendarListener) {
1856-
this.destroyCalendarListener();
1857-
}
1858-
18591827
this.setWorkingParts({
18601828
...workingParts,
18611829
month: ev.detail.value,
@@ -1866,10 +1834,6 @@ export class Datetime implements ComponentInterface {
18661834
month: ev.detail.value,
18671835
});
18681836

1869-
// We can re-attach the scroll listener after
1870-
// the working parts have been updated.
1871-
this.initializeCalendarListener();
1872-
18731837
ev.stopPropagation();
18741838
}}
18751839
>
@@ -1902,14 +1866,6 @@ export class Datetime implements ComponentInterface {
19021866
disabled={disabled}
19031867
value={workingParts.year}
19041868
onIonChange={(ev: CustomEvent) => {
1905-
// TODO(FW-1823) Remove this when iOS 14 support is dropped.
1906-
// Due to a Safari 14 issue we need to destroy
1907-
// the scroll listener before we update state
1908-
// and trigger a re-render.
1909-
if (this.destroyCalendarListener) {
1910-
this.destroyCalendarListener();
1911-
}
1912-
19131869
this.setWorkingParts({
19141870
...workingParts,
19151871
year: ev.detail.value,
@@ -1920,10 +1876,6 @@ export class Datetime implements ComponentInterface {
19201876
year: ev.detail.value,
19211877
});
19221878

1923-
// We can re-attach the scroll listener after
1924-
// the working parts have been updated.
1925-
this.initializeCalendarListener();
1926-
19271879
ev.stopPropagation();
19281880
}}
19291881
>

0 commit comments

Comments
 (0)