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

681 show disabled arrows #1264

Merged
merged 1 commit into from
Mar 12, 2018

Conversation

imjonrourke
Copy link
Contributor

681-show-disabled-arrows-screenshot
Resolves #681

@Alfredo-Delgado
Copy link

The new functionality is behind a config flag (e.g. showDisabledArrows ) set to false so existing users' experience won't be affected. I'm not sure how to put in a PR for the documentation.

@chmln
Copy link
Member

chmln commented Mar 9, 2018

Thanks @imjonrourke for the contribution :)

I don't think an option is necessary however.
Just add the disabled class and hide the arrows via display:none by default.

If you wanna show the arrows for whatever reason, you can override this with custom CSS.

src/index.ts Outdated
@@ -872,7 +874,9 @@ function FlatpickrInstance(
get: () => self.__hideNextMonthArrow,
set(bool: boolean) {
if (self.__hideNextMonthArrow !== bool)
self.nextMonthNav.style.display = bool ? "none" : "block";
if (self.config.showDisabledArrows) {
toggleClass(self.nextMonthNav, "disabled", bool);
Copy link
Member

Choose a reason for hiding this comment

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

This should be extracted out of the if condition and the else block should be removed.

@@ -226,6 +226,13 @@
transition fill 0.1s
fill inherit

&.disabled
&, &:hover
Copy link
Member

Choose a reason for hiding this comment

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

This should go in your application's custom CSS.
The only thing here should be display: none

@@ -509,8 +516,7 @@ span.flatpickr-weekday
cursor default

&.disabled, &.disabled:hover
cursor not-allowed
color alpha($dayForeground, 0.1)
@extend .flatpickr-prev-month.disabled
Copy link
Member

Choose a reason for hiding this comment

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

This is not very relevant.
As mentioned, should go in your custom CSS.

@Alfredo-Delgado
Copy link

Updated implementation and tests per code review.

@@ -853,17 +853,21 @@ function FlatpickrInstance(
Object.defineProperty(self, "_hidePrevMonthArrow", {
get: () => self.__hidePrevMonthArrow,
set(bool: boolean) {
if (self.__hidePrevMonthArrow !== bool)
if (self.__hidePrevMonthArrow !== bool) {

Choose a reason for hiding this comment

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

I'm not sure if you want to keep the if statements, @chmln, so I left them in.

@chmln chmln merged commit 429c47b into flatpickr:master Mar 12, 2018
@chmln
Copy link
Member

chmln commented Mar 12, 2018

Great work, thanks all for contributing 👍

@Alfredo-Delgado
Copy link

Thanks for maintaining flatpickr! Do you publish on a schedule?

@chmln
Copy link
Member

chmln commented Mar 13, 2018

@Alfredo-Delgado whenever I get free time. the next release is highly anticipated, but with the plethora of recent changes additional testing is necessary to prevent bugs from creeping into users' production.

If I gave an ETA it would be within the next 3-5 days

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.

None yet

3 participants