Skip to content

Commit 9b3d7ea

Browse files
author
Jonathan
committed
fix toggle #2950
1 parent ed815a3 commit 9b3d7ea

File tree

6 files changed

+32
-19
lines changed

6 files changed

+32
-19
lines changed

build/change-version.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ async function replaceRecursively(file, oldVersion, newVersion) {
5353
return;
5454
}
5555

56-
if (VERBOSE) {
57-
console.log(`FILE: ${file}`);
58-
}
56+
//if (VERBOSE) {
57+
console.log(`FILE: ${file}`);
58+
//}
5959

6060
if (DRY_RUN) {
6161
return;

package-lock.json

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"docs": "node ./src/docs/make.js",
3636
"docs-watch": "node ./src/docs/make.js --watch",
3737
"release": "npm run eslint && npm run test:silent && npm run build",
38-
"release:version": "npm run release && node build/change-version.js",
38+
"release:version": "npm run clean && node build/change-version.js \"$npm_config_argv_0\" && npm run release",
3939
"prepare": "husky install",
4040
"prettier": "prettier --ignore-unknown --write .",
4141
"eslint": "npm run prettier && npx eslint --ext .html,.ts ."

src/js/display/calendar/date-display.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export default class DateDisplay {
5757
const div = document.createElement('div');
5858
div.setAttribute('data-action', ActionTypes.selectDay);
5959
div.role = 'gridcell';
60-
div.tabIndex = -1;
60+
div.tabIndex = 0;
6161
container.appendChild(div);
6262

6363
// if hover is supported then add the events

src/js/display/index.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,19 @@ export default class Display {
179179
this.optionsStore.options?.display?.placement || 'bottom';
180180

181181
container.appendChild(this.widget);
182+
const handleFocus = this._handleFocus.bind(this);
182183
this.createPopup(this.optionsStore.element, this.widget, {
183-
modifiers: [{ name: 'eventListeners', enabled: true }],
184+
modifiers: [
185+
{ name: 'eventListeners', enabled: true },
186+
{
187+
name: 'focusDate',
188+
enabled: true,
189+
phase: 'afterWrite',
190+
fn() {
191+
handleFocus();
192+
},
193+
},
194+
],
184195
//#2400
185196
placement:
186197
document.documentElement.dir === 'rtl'
@@ -316,7 +327,7 @@ export default class Display {
316327
updatePopup(): void {
317328
if (!this._popperInstance) return;
318329
this._popperInstance.update();
319-
this._handleFocus();
330+
//this._handleFocus();
320331
}
321332

322333
/**
@@ -519,7 +530,8 @@ export default class Display {
519530
if (this.optionsStore.options.display.keyboardNavigation) {
520531
this.widget.removeEventListener('keydown', this._keyboardEventBound);
521532
}
522-
this.optionsStore.toggle?.focus();
533+
if (this.optionsStore.toggle) this.optionsStore.toggle.focus();
534+
else if (this.optionsStore.input) this.optionsStore.input.focus();
523535
}
524536

525537
/**
@@ -1161,6 +1173,7 @@ export default class Display {
11611173
};
11621174

11631175
const tabTargets: HTMLElement[] = [];
1176+
console.log(this.optionsStore.currentView);
11641177
switch (this.optionsStore.currentView) {
11651178
case 'clock':
11661179
{

src/js/jQuery-provider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*global $, tempusDominus */
33

44
/*!
5-
* Tempus Dominus v6.9.4 (https://getdatepicker.com/)
5+
* Tempus Dominus v6.10.3 (https://getdatepicker.com/)
66
* Copyright 2013-2021 Jonathan Peterson
77
* Licensed under MIT (https://github.com/Eonasdan/tempus-dominus/blob/master/LICENSE)
88
*/

0 commit comments

Comments
 (0)