Skip to content

Commit

Permalink
No hover interaction if disableYearOverlay (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
jvlobo authored Nov 29, 2022
1 parent a47301f commit 252a4c9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions cypress/integration/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@ describe('User options', function() {

cy.get(singleDatepickerInput).click()
cy.get(single.overlay).should('have.class', 'qs-hidden')
cy.get(`${single.controls} .qs-month-year`).should('have.class', 'qs-disabled-year-overlay')
cy.get(`${single.controls} .qs-month-year`).click()
cy.get(single.overlay).should('have.class', 'qs-hidden')
})
Expand Down
2 changes: 1 addition & 1 deletion src/datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ function createControls(date, instance, overlayOpen) {
return [
'<div class="qs-controls' + (overlayOpen ? ' qs-blur' : '') + '">',
'<div class="qs-arrow qs-left"></div>',
'<div class="qs-month-year">',
'<div class="qs-month-year' + (instance.disableYearOverlay ? ' qs-disabled-year-overlay' : '') + '">',
'<span class="qs-month">' + instance.months[date.getMonth()] + '</span>',
'<span class="qs-year">' + date.getFullYear() + '</span>',
'</div>',
Expand Down
9 changes: 6 additions & 3 deletions src/datepicker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,13 @@ $lightblue: lightblue;
font-weight: bold;
transition: border .2s;
border-bottom: 1px solid transparent;
cursor: pointer;

&:hover {
border-bottom: 1px solid gray;
&:not(.qs-disabled-year-overlay) {
cursor: pointer;

&:hover {
border-bottom: 1px solid gray;
}
}

&:focus,
Expand Down

0 comments on commit 252a4c9

Please sign in to comment.