-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
681 show disabled arrows #1264
Conversation
The new functionality is behind a config flag (e.g. |
Thanks @imjonrourke for the contribution :) I don't think an option is necessary however. 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); |
There was a problem hiding this comment.
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.
src/style/flatpickr.styl
Outdated
@@ -226,6 +226,13 @@ | |||
transition fill 0.1s | |||
fill inherit | |||
|
|||
&.disabled | |||
&, &:hover |
There was a problem hiding this comment.
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
src/style/flatpickr.styl
Outdated
@@ -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 |
There was a problem hiding this comment.
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.
4019e36
to
2c611c2
Compare
2c611c2
to
a708388
Compare
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) { |
There was a problem hiding this comment.
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.
Great work, thanks all for contributing 👍 |
Thanks for maintaining flatpickr! Do you publish on a schedule? |
@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 |
Resolves #681