T1334896 - DateBox — Value isn't reset after selecting a date and clearing the input with Backspace in Firefox - #35144
T1334896 - DateBox — Value isn't reset after selecting a date and clearing the input with Backspace in Firefox#35144Raushen wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
🟢 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
changeonfocusoutwhenvalueChangeEventincludeschangeand 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
changedoes 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.
There was a problem hiding this comment.
🟡 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
_handledTextis only assigned in the value-change handler and is never invalidated when_renderValuereplacestextafter 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 withoutchangeleaves 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
| if (this._shouldCommitTextOnFocusOut()) { | ||
| eventsEngine.triggerHandler(this._input(), { type: 'change' }); | ||
| } |
No description provided.