Skip to content

fix: ipad issue #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 3, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/datetimepicker.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export class DateTimePickerStyle extends DateTimePickerStyleBase {
export class DateTimePicker extends DateTimePickerBase {
public static PICKER_DEFAULT_MESSAGE_HEIGHT = 192;
public static PICKER_WIDTH_INSETS = 16;
public static PICKER_WIDTH_PAD = 304;
public static PICKER_DEFAULT_TITLE_OFFSET = 26.5;
public static PICKER_DEFAULT_TITLE_HEIGHT = 16;
public static PICKER_DEFAULT_MESSAGE = "\n\n\n\n\n\n\n\n\n";
Expand Down Expand Up @@ -72,7 +73,8 @@ export class DateTimePicker extends DateTimePickerBase {
const alertController = UIAlertController.alertControllerWithTitleMessagePreferredStyle(
alertTitle, DateTimePicker.PICKER_DEFAULT_MESSAGE, UIAlertControllerStyle.ActionSheet);
const alertSize = Math.min(alertController.view.frame.size.width, alertController.view.frame.size.height);
const pickerViewWidth = alertSize - DateTimePicker.PICKER_WIDTH_INSETS;
const pickerViewWidth = UIDevice.currentDevice.userInterfaceIdiom === UIUserInterfaceIdiom.Pad ?
DateTimePicker.PICKER_WIDTH_PAD : alertSize - DateTimePicker.PICKER_WIDTH_INSETS;

let pickerContainerFrameTop = DateTimePicker.PICKER_DEFAULT_TITLE_OFFSET;
if (options.title) {
Expand Down