Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2317)

Unified Diff: Source/web/resources/calendarPicker.js

Issue 556323003: Calendar Picker: Make month popup cells non-focusable. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/resources/calendarPicker.css ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/resources/calendarPicker.js
diff --git a/Source/web/resources/calendarPicker.js b/Source/web/resources/calendarPicker.js
index 2459e401c4237a186e0039c67c54ad271412b12d..e593be169809b5758bbf38e868a6cc4b4c7ddcc4 100644
--- a/Source/web/resources/calendarPicker.js
+++ b/Source/web/resources/calendarPicker.js
@@ -2146,7 +2146,7 @@ function YearListCell(shortMonthLabels) {
var buttonsRow = createElement("div", YearListCell.ClassNameMonthButtonsRow);
for (var c = 0; c < YearListCell.ButtonColumns; ++c) {
var month = c + r * YearListCell.ButtonColumns;
- var button = createElement("button", YearListCell.ClassNameMonthButton, shortMonthLabels[month]);
+ var button = createElement("div", YearListCell.ClassNameMonthButton, shortMonthLabels[month]);
button.dataset.month = month;
buttonsRow.appendChild(button);
this.monthButtons.push(button);
@@ -2409,7 +2409,7 @@ YearListView.prototype.onClick = function(event) {
this.scrollView.scrollTo(this.selectedRow * YearListCell.Height, true);
} else {
var monthButton = enclosingNodeOrSelfWithClass(event.target, YearListCell.ClassNameMonthButton);
- if (!monthButton)
+ if (!monthButton || monthButton.getAttribute("aria-disabled") == "true")
return;
var month = parseInt(monthButton.dataset.month, 10);
this.dispatchEvent(YearListView.EventTypeYearListViewDidSelectMonth, this, new Month(year, month));
@@ -2480,7 +2480,7 @@ YearListView.prototype.prepareNewCell = function(row) {
}
for (var i = 0; i < cell.monthButtons.length; ++i) {
var month = new Month(row + 1, i);
- cell.monthButtons[i].disabled = this._minimumMonth > month || this._maximumMonth < month;
+ cell.monthButtons[i].setAttribute("aria-disabled", this._minimumMonth > month || this._maximumMonth < month ? "true" : "false");
}
var animator = this._runningAnimators[row];
if (animator)
@@ -2586,7 +2586,7 @@ YearListView.prototype.selectWithoutAnimating = function(row) {
/**
* @param {!Month} month
- * @return {?HTMLButtonElement}
+ * @return {?HTMLDivElement}
*/
YearListView.prototype.buttonForMonth = function(month) {
if (!month)
« no previous file with comments | « Source/web/resources/calendarPicker.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698