Skip to content
This repository was archived by the owner on Sep 15, 2026. It is now read-only.
This repository was archived by the owner on Sep 15, 2026. It is now read-only.

Binding fails when setting null value and the old value persists. #288

Description

@IvayloG

Description

Binding fails when setting null value.

Steps to reproduce

Use the repository samples - igEditors sample http://localhost:3002/samples/igEditors/igEditors.html and add/update with the following code snippets:

  1. igEditorsTemplate.html
<tr>
	<td>igDatePicker</td>
	<td><input class="form-control" type="text" id="datePicker11" [(ngModel)]="editors.date" /></td>
	<td><ig-date-picker widgetId="datePicker1" [(ngModel)]="editors.date"  [options]="{width:'100%', revertIfNotValid:false, allowNullValue:true}"></ig-date-picker></td>
</tr>
<br/>
<button type="button" class="btn btn-default" (click)="setNullDate()">set Null Date</button>
<button type="button" class="btn btn-default" (click)="setNewDate()">set New Date</button>
<button type="button" class="btn btn-default" (click)="setEmptyString()">set Empty String</button>
  1. app.ts
	setNullDate(){
		this.editors.date = null;
	}

	setNewDate(){
		this.editors.date = new Date();
	}

	setEmptyString(){
		this.editors.date = "";
	}

Result

When setting allowNullValue:true: Once there is a valid date set, and setting the value to null the editor value is not set to null but the old one persists.

When setting allowNullValue:false and revertIfNotValid:false: Once there is a valid date set, and setting the value to null the editor value is not set to empty string but the old one persists..

Expected result

When setting allowNullValue:true , the editor value should become null.
When setting allowNullValue:false and revertIfNotValid:false, the editor value should become empty string.

Activity

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions