Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
### Fixed
- #### DateTime Input
- Ensure `igcChange` is emitted in case an incomplete mask value has been filled [#1695](https://github.com/IgniteUI/igniteui-webcomponents/issues/1695)

## [6.0.0] - 2025-04-29
### Changed
- Minimum Node version required is now >= 20.
Expand Down
18 changes: 18 additions & 0 deletions src/components/date-time-input/date-time-input.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,24 @@ describe('Date Time Input component', () => {
expect(input.value).to.equal('22-07-2024');
});

it('should emit igcChange on blur after an incomplete mask has been parsed - issue #1695', async () => {
const eventSpy = spy(el, 'emitEvent');
el.focus();
await elementUpdated(el);

simulateInput(input, {
value: '0',
inputType: 'insertText',
});
await elementUpdated(el);

el.blur();
await elementUpdated(el);

expect(eventSpy).calledWith('igcChange');
expect(input.value).to.deep.equal('01/01/2000');
});

it('should correctly switch between different pre-defined date formats', async () => {
const targetDate = new Date(2020, 2, 3, 0, 0, 0, 0);

Expand Down
3 changes: 2 additions & 1 deletion src/components/date-time-input/date-time-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,6 @@ export default class IgcDateTimeInputComponent extends EventEmitterMixin<

protected handleBlur() {
const isEmptyMask = this.maskedValue === this.emptyMask;
const isSameValue = this._oldValue === this.value;

this.focused = false;

Expand All @@ -626,6 +625,8 @@ export default class IgcDateTimeInputComponent extends EventEmitterMixin<
this.updateMask();
}

const isSameValue = this._oldValue === this.value;

if (!(this.readOnly || isSameValue)) {
this.emitEvent('igcChange', { detail: this.value });
}
Expand Down