You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If minYear and maxYear are provided, the .is-disabled class should be added to both arrow buttons and they should not be clickable anymore.
Current Behavior
The .is-disabled class is only added to the rightArrow (next) and both buttons are always clickable.
Possible Solution
Two things are not working as expected. First, the class .is-disabled is only added to the next month button. I've identified the line of code that is causing this and realized that the statements seem to be in the wrong order for the leftArrow (see comment in code):
varleftArrow='<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"/><path d="M0-.5h24v24H0z" fill="none"/></svg>';html+="<button class=\"month-prev"+(prev ? '' : ' is-disabled')+"\" type=\"button\">"+leftArrow+"</button>";html+='<div class="selects-container">';if(opts.showMonthAfterYear){html+=yearHtml+monthHtml;}else{html+=monthHtml+yearHtml;}html+='</div>';// this if must be evaluated before leftArrow is initialized because otherwise prev will always be true or initialization of leftArrow must happen laterif(isMinYear&&(month===0||opts.minMonth>=month)){prev=false;}if(isMaxYear&&(month===11||opts.maxMonth<=month)){next=false;}varrightArrow='<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"/><path d="M0-.25h24v24H0z" fill="none"/></svg>';html+="<button class=\"month-next"+(next ? '' : ' is-disabled')+"\" type=\"button\">"+rightArrow+"</button>";
Furthermore, the .is-disabled class doesn't has an impact on the two buttons because a matching CSS rule is missing. An example rule that shows the expected behavior would be:
The back button does not have the .is-disabled class and is clickable despite the minYear is 1970 and the button should be disabled while being in January 1970.
Go to year 2010 (maxYear) and monthDecember. The button does have the .is-disable class but is still clickable.
Context
The buttons staying visible is misleading for the user because it is not clear that (s)he reached the minYear or maxYear. Furthermore, the behavior is inconsistent with the documentation and the implementation itself (leftArrow vs. rightArrow).
Your Environment
Materialize 1.0.0, tested in Google Chrome
Version used: 1.0.0
Browser Name and version: Google Chrome 80.0.*
Operating System and version (desktop or mobile): Windows 10 1909 (Desktop)
Expected Behavior
If
minYear
andmaxYear
are provided, the.is-disabled
class should be added to both arrow buttons and they should not be clickable anymore.Current Behavior
The
.is-disabled
class is only added to therightArrow
(next
) and both buttons are always clickable.Possible Solution
Two things are not working as expected. First, the class
.is-disabled
is only added to thenext month
button. I've identified the line of code that is causing this and realized that the statements seem to be in the wrong order for theleftArrow
(see comment in code):Furthermore, the
.is-disabled
class doesn't has an impact on the two buttons because a matching CSS rule is missing. An example rule that shows the expected behavior would be:Steps to Reproduce (for bugs)
JSFiddle link: https://jsfiddle.net/guc3sjzh/
.is-disabled
class and is clickable despite theminYear
is 1970 and the button should be disabled while being in January 1970.maxYear
) andmonth
December. The button does have the.is-disable
class but is still clickable.Context
The buttons staying visible is misleading for the user because it is not clear that (s)he reached the
minYear
ormaxYear
. Furthermore, the behavior is inconsistent with the documentation and the implementation itself (leftArrow
vs.rightArrow
).Your Environment
Materialize 1.0.0, tested in Google Chrome
The text was updated successfully, but these errors were encountered: