Skip to content

fix(ios): time-picker and date-picker for iOS 14#8877

Merged
NathanWalker merged 1 commit into
NativeScript:masterfrom
asharghi:master
Sep 23, 2020
Merged

fix(ios): time-picker and date-picker for iOS 14#8877
NathanWalker merged 1 commit into
NativeScript:masterfrom
asharghi:master

Conversation

@asharghi
Copy link
Copy Markdown
Contributor

@asharghi asharghi commented Sep 21, 2020

PR Checklist

What is the current behavior?

TimePicker/DatePicker crashes on iOS 14

What is the new behavior?

Does not crash

Fixes/Implements/Closes #8862 #8880

@cla-bot cla-bot Bot added the cla: yes label Sep 21, 2020
@NathanWalker
Copy link
Copy Markdown
Contributor

Nice work @asharghi 👏 thank you - we'll test with the changeset this week 👍

@asharghi asharghi mentioned this pull request Sep 22, 2020
@NathanWalker NathanWalker merged commit 45fb6c4 into NativeScript:master Sep 23, 2020
@JCFowler
Copy link
Copy Markdown

@NathanWalker
Sorry noob question, I see this PR was merged into master. When would this change be sent to NPM, so we can download the fix? Or is there another way to grab this fix?

Thanks!

@ian-s-mac
Copy link
Copy Markdown

I see this is released in 7.0.4. We are still on 6.5.x - will it be backported?

@asharghi
Copy link
Copy Markdown
Contributor Author

It is backported @ian-s-mac . You can upgrade your tns-core-modules to 6.5.19


export * from './date-picker-common';

const SUPPORT_DATE_PICKER_STYLE = parseFloat(Device.os) >= 14.0;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be Device.osVersion?

The documentations says:

export interface IDevice {
...
	/**
	 * Gets the OS of the device.
	 * For example: "Android" or "iOS".
	 */
	os: string;
...
}
/**
 * Gets the OS version.
 * For example: 4.4.4(android), 8.1(ios)
 */
osVersion: string;

@ian-s-mac
Copy link
Copy Markdown

I think you are right. when using "device.os", both SUPPORT_DATE_PICKER_STYLE an SUPPORT_TEXT_COLOR always equal false.

image

And the date picker on iOS 14 looks like this

image

If I edit the code to use osVersion, then SUPPORT_DATE_PICKER_STYLE correctly resolve to true and is set on iOS 14

image

and the date picker looks like this

image

@asharghi
Copy link
Copy Markdown
Contributor Author

You are right. That's my bad. But now that I think about it, do we want to override the default behavior of the os and always use the old style as default?

@alexander-mai
Copy link
Copy Markdown

To have a quick fix, I would do it this way.
Then it can be improved in peace.

@asharghi
Copy link
Copy Markdown
Contributor Author

What do you guys think about this #8899

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nativescript 7 TimePicker/DatePicker error (iOS)

6 participants