Select to view content in your preferred language

Date Picker in update feature attributes sample

526
2
Jump to solution
05-12-2023 05:45 AM
MarkosK
New Contributor II

I was lookin at the sample below.

https://developers.arcgis.com/javascript/latest/sample-code/editing-groupedfeatureform/Sandbox | Sam...

Date of inspection field is not responding when clicking the month navigation. in the sample and I can change the date in the same month. I do not se any min or max vakues set.

Is there something I missed?

Markos

 

 

Tags (1)
1 Solution

Accepted Solutions
JoelBennett
MVP Regular Contributor

This appears to be a bug in the esri/chunks/calcite-input-date-picker module, and I don't think there's much you can do about it.  You'll notice when you click on the arrow for the next month, the calender does flash briefly to the next month, but then gets reset.  Whenever certain elements on the form are clicked, the values on the form are reset from a copy of the values in memory.  Therefore, the value does get set to the next month when you click the arrow, but it immediately gets reset due to conflicting event handlers.

Within the aforementioned module, this handler executes when you click one of the previous or next month arrows:

this.handleArrowClick = (a,b)=>{
	a.preventDefault();
	this.calciteInternalDatePickerSelect.emit(b)
}

If it were changed to this, it would work properly (note addition at line 3):

this.handleArrowClick = (a,b)=>{
	a.preventDefault();
	a.cancelBubble = true; //added line
	this.calciteInternalDatePickerSelect.emit(b)
}

If you're hosting the API locally, you can apply this change.  If not, perhaps it will get fixed in a future release.

View solution in original post

2 Replies
KenBuja
MVP Esteemed Contributor

There doesn't appear to be an "inpt_date" field in the underlying data. I don't know if this is what's affecting the date picker. You can manually put in another month by typing it in.

0 Kudos
JoelBennett
MVP Regular Contributor

This appears to be a bug in the esri/chunks/calcite-input-date-picker module, and I don't think there's much you can do about it.  You'll notice when you click on the arrow for the next month, the calender does flash briefly to the next month, but then gets reset.  Whenever certain elements on the form are clicked, the values on the form are reset from a copy of the values in memory.  Therefore, the value does get set to the next month when you click the arrow, but it immediately gets reset due to conflicting event handlers.

Within the aforementioned module, this handler executes when you click one of the previous or next month arrows:

this.handleArrowClick = (a,b)=>{
	a.preventDefault();
	this.calciteInternalDatePickerSelect.emit(b)
}

If it were changed to this, it would work properly (note addition at line 3):

this.handleArrowClick = (a,b)=>{
	a.preventDefault();
	a.cancelBubble = true; //added line
	this.calciteInternalDatePickerSelect.emit(b)
}

If you're hosting the API locally, you can apply this change.  If not, perhaps it will get fixed in a future release.