@akira-yylm/session-calendar 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.0.2
4
+
5
+ - 修复:用方向键跨月翻阅时,选中的日期按钮随旧月份被卸载,焦点掉到页面 body,之后方向键就失效(必须先点一次日期)。现在跨月的瞬间把焦点交给卡片本身,方向键可以一路连着按下去。
6
+
3
7
  ## 2.0.1
4
8
 
5
9
  - 重新发布:2.0.0 在浏览器 2FA 流程中上传中断,注册表只留下元数据、压缩包缺失;npm 不允许重复发布同一版本号,因此同样的内容以 2.0.1 发布。功能与 2.0.0 完全一致(见下节)。
package/client.js CHANGED
@@ -1609,7 +1609,14 @@ window.__ModuleLoader__.load({
1609
1609
  const parts = selected.split('-')
1610
1610
  const next = new Date(Number(parts[0]), Number(parts[1]) - 1, Number(parts[2]) + step)
1611
1611
  setSelected(dayKeyOf(next))
1612
- if (!sameMonth(month, next)) setMonth(monthStartOf(next))
1612
+ if (!sameMonth(month, next)) {
1613
+ setMonth(monthStartOf(next))
1614
+ // The focused date button belongs to the month being replaced, so it
1615
+ // is unmounted and focus would fall back to the document body — the
1616
+ // next arrow key would then look like it came from outside the card.
1617
+ // Move focus to the card itself before the grid re-renders.
1618
+ card.focus({ preventScroll: true })
1619
+ }
1613
1620
  }
1614
1621
  document.addEventListener('keydown', onArrow)
1615
1622
  return () => { document.removeEventListener('keydown', onArrow) }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akira-yylm/session-calendar",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "type": "module",
5
5
  "description": "Session calendar: a month calendar beside the sidebar listing every session created on the selected day, grouped by workspace.",
6
6
  "license": "MIT",