Skip to content
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

Exposed doneButton enabled variable and added option to avoid auto-selection of day when releasing scrolling #112

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

palla89
Copy link

@palla89 palla89 commented Dec 16, 2021

var is doneButtonIsEnabled and the other var is autoSelectDayOnStopScroll

Copy link
Owner

@itsmeichigo itsmeichigo left a comment

Choose a reason for hiding this comment

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

Thank you @palla89 for the contribution! As mentioned in one of the comments below, I'm not fond of disabling auto-selection so I'd like to ask you to remove it from this PR if you don't mind. I also have a few comments on the done button update, please take a look 😄

Comment on lines +17 to +21
public var doneButtonIsEnabled: Bool = true {
didSet {
doneButton.isEnabled = doneButtonIsEnabled
}
}
Copy link
Owner

Choose a reason for hiding this comment

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

A few nits:

  • I think it's nicer if we use a method instead of this long awkward variable name. So instead we can have something like: func enableDoneButton(_ enabled: Bool).
  • The indenting doesn't quite match with the rest of the file, can you please update it?
  • When the done button is disabled, I find that it still looks the same as when it's enabled so it doesn't look obvious and can be mistaken with an issue. How about updating the button's look (i.e make it grey) when it's disabled?

@@ -260,6 +266,9 @@ public protocol DateTimePickerDelegate: AnyObject {
timeZone = calendar.timeZone
}
}

public var autoSelectDayOnStopScroll: Bool = true
Copy link
Owner

Choose a reason for hiding this comment

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

I'm not quite fond of this feature, as although someone requested it I find it looks buggy and not what I intended for the library. I think it's fine if someone wants it for their app, they can maybe tweak it to their need; but I'd prefer to leave it off the library for now. WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants