Skip to content

T1334896 - DateBox — Value isn't reset after selecting a date and clearing the input with Backspace in Firefox - #35144

Open
Raushen wants to merge 2 commits into
DevExpress:mainfrom
Raushen:T1334896_26_2
Open

T1334896 - DateBox — Value isn't reset after selecting a date and clearing the input with Backspace in Firefox#35144
Raushen wants to merge 2 commits into
DevExpress:mainfrom
Raushen:T1334896_26_2

Conversation

@Raushen

@Raushen Raushen commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@Raushen Raushen self-assigned this Sep 10, 2026
@Raushen
Raushen requested a review from a team as a code owner September 10, 2026 12:17
Copilot AI lite review requested due to automatic review settings September 10, 2026 12:17
@Raushen Raushen added the 26_2 label Sep 10, 2026

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 fix is narrowly scoped, follows existing internal patterns (synthetic change triggering), and is backed by targeted Jest coverage for the reported scenario and key regressions.

Pull request overview

Fixes a Firefox-specific DateBox behavior where clearing the input after selecting a date (e.g., via Backspace) does not reset the value, by ensuring pending text is committed on focus out when a change event is expected but not fired.

Changes:

  • Trigger a synthetic change on focusout when valueChangeEvent includes change and the displayed text differs from the current value’s formatted text.
  • Add Jest coverage for clearing-after-pick scenarios (including mask mode) and for avoiding duplicate commits when change does fire.
  • Introduce/reuse lightweight Jest page-model helpers for text-based editors and DateBox calendar interaction.
File summaries
File Description
packages/devextreme/js/__internal/ui/date_box/date_box.base.ts Commits edited/cleared text on focus out by triggering a change handler when needed.
packages/devextreme/js/__internal/ui/date_box/tests/date_box.test.ts Adds Jest tests covering the Firefox scenario, mask mode, and non-duplication when change fires.
packages/devextreme/js/__internal/ui/tests/mock/model/text_editor.ts Adds shared test model helpers for clearing/blurring text editor inputs.
packages/devextreme/js/__internal/ui/tests/mock/model/drop_down_editor.ts Refactors test model to inherit text editor helpers for reuse.
packages/devextreme/js/__internal/ui/tests/mock/model/date_box.ts Adds DateBox test model for accessing the widget instance and calendar cells.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0
  • Review effort level: Lite

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

Copilot AI review requested due to automatic review settings September 10, 2026 22:59

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.

🟡 Changes recommended

A moderate duplicate change-event issue remains in masked mode.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

packages/devextreme/js/__internal/ui/date_box/date_box.base.ts:601

  • _handledText is only assigned in the value-change handler and is never invalidated when _renderValue replaces text after a calendar or programmatic value change. If a user later enters the same text that was handled for the previous value, this stale equality makes the guard return early even though the text differs from the current displayed value, so a Firefox blur without change leaves the value/text out of sync. Reset this marker when rendering a new value, or associate it with the value it was handled for.
    if (!includesChangeEvent || text === this._handledText) {
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment on lines +590 to +592
if (this._shouldCommitTextOnFocusOut()) {
eventsEngine.triggerHandler(this._input(), { type: 'change' });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants