Skip to content

ELEMENTS-2095: Keep calendar open during month navigation [lts-2025] - #1735

Open
vivekchaturved013 wants to merge 5 commits into
develop-2025from
fix-ELEMENTS-2095-calendar-focus-lts-2025
Open

vivekchaturved013 wants to merge 5 commits into
develop-2025from
fix-ELEMENTS-2095-calendar-focus-lts-2025

Conversation

@vivekchaturved013

@vivekchaturved013 vivekchaturved013 commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

The calendar can close after Previous-month navigation when a calendar control loses focus. The nuxeo-date-picker wrapper refocuses the text input on focusout, and the inner picker closes its popover when that input receives focus. Its 200 ms suppression window does not remove that conflict.

Changes

  • Remove the wrapper's forced refocus and the navigation suppression timers.
  • Resolve actual focus through nested shadow roots; preserve focus inside an open popover when the picker host receives a focus request.
  • Keep outside focus and text-input focus closing the calendar, including when both controls share an outer shadow host.
  • Avoid rebuilding unused month-year options during navigation.
  • Add coverage for navigation without min, focus loss after the old grace period, nested hosts, Enter/Space, the year dropdown, and first-click date selection. Add a disabled minimum-date focus target regression and retain the existing min-boundary tests.

Validation

  • npm run format, npm run lint, and npm test passed on both release bases.
  • Per base: 164 core + 4,022 UI + 29 dataviz tests passed; two existing skipped tests.
  • Both complete picker suites: 801 passed.
  • Web UI production builds passed with baseline and final patched Elements. In the real Workspace Expires dialog, forcing focus loss after Previous-month navigation closes the baseline and leaves the patched calendar open. History From/To each stayed open through three Previous clicks on both builds.
  • Before/after screenshots and videos are attached to ELEMENTS-2095.

Reproduction and limits

Both the isolated browser harness and the actual Workspace edit dialog reproduce the focus-loss chain after navigating back one month and blurring the focused day cell after the 200 ms window. The baseline closes the calendar and the patched code leaves it open. Previous-click alone did not close it in this environment, consistent with the ticket's earlier analysis; this evidence is a deterministic reproduction of the focus conflict, rather than a claim that every reported environment was reproduced.

The shared picker is used by document create/edit/import layouts, History date ranges, permission dates, workflow forms, and addons. QA should verify these consumers with mouse and keyboard. No new i18n keys, dependency changes, or vendored changes.

Remove the wrapper focusout workaround that refocused the text input and
closed the calendar when a day or navigation control lost focus. Resolve
focus across nested shadow roots and keep external focus requests inside
the open popover, rather than relying on a 200 ms suppression window.

Avoid rebuilding unused month-year options during navigation. Cover
unbounded navigation, focus loss, nested hosts, keyboard interaction,
outside focus, typing, year selection, and first-click date selection.
@vivekchaturved013
vivekchaturved013 requested a review from a team as a code owner October 9, 2026 06:53
@vivekchaturved013
vivekchaturved013 requested review from akoppaka and naveen-konda and removed request for a team October 9, 2026 06:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused implementation addresses the reported conflict and is supported by comprehensive regression coverage.

0 open findings

What changed in this PR

Fixes calendar dismissal during month navigation by correcting focus handling across nested shadow roots.

Changes:

  • Removes conflicting refocus and timing-based suppression logic.
  • Preserves calendar focus while retaining outside-focus dismissal.
  • Adds comprehensive focus, navigation, and date-selection regressions.
File Description
ui/​widgets/​nuxeo-date-picker.js Removes wrapper-driven refocusing.
ui/​widgets/​custom-date-picker.js Adds shadow-aware focus handling and simplifies navigation.
ui/​test/​nuxeo-date-picker.test.js Covers wrapper and nested-focus regressions.
ui/​test/​custom-date-picker.test.js Expands focus, navigation, boundary, and keyboard coverage.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@naveen-konda
naveen-konda changed the base branch from lts-2025 to develop-2025 October 12, 2026 12:06
This pull request was retargeted from the release branch to its dev branch.
GitHub does not re-run checks on a base change, so this empty commit forces a
fresh run against the new base. No content change.
cursor[bot]

This comment was marked as outdated.

…-2025

Conflict: custom-date-picker.js module scope. develop-2025 hoisted
COMMON_INPUT_FORMATS and VALID_MOMENT_TOKENS next to FOCUS_SUPPRESSION_MS;
this branch deletes FOCUS_SUPPRESSION_MS. Kept both new constants and the
deletion.
… date

The focus() fallback test pinned min to 2026-10-15 and viewed October 2026.
_getDayTabIndex makes today's cell the tab stop whenever today is in the
viewed month, so the test only saw a disabled tab stop while the suite ran
before 15 October 2026, and started failing on the 16th.

View January 2020 instead: no selection and no today in that month, so the
tab stop is the 1st, and a min of 2020-02-01 leaves it disabled whatever the
current date is. min is assigned last because _minChanged is what regenerates
the grid.
@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants