Skip to content

Commit 1478c34

Browse files
committedMar 19, 2025
Hotfix for pnp#1937 and 1961. Enabled the allowTextInput on date fields
1 parent 97ea68c commit 1478c34

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed
 

‎src/controls/dynamicForm/DynamicForm.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ export class DynamicFormBase extends React.Component<
459459
if (fieldcolumnInternalName.startsWith('_x') || fieldcolumnInternalName.startsWith('_')) {
460460
fieldcolumnInternalName = `OData_${fieldcolumnInternalName}`;
461461
}
462-
if (field.newValue !== null && field.newValue !== undefined) {
462+
if (field.newValue !== undefined) {
463463

464464
let value = field.newValue;
465465

@@ -491,7 +491,7 @@ export class DynamicFormBase extends React.Component<
491491
value.push(element.key);
492492
});
493493
objects[`${fieldcolumnInternalName}Id`] = {
494-
results: value.length === 0 ? null : value,
494+
results: value.length === 0 ? [] : value,
495495
};
496496
}
497497

@@ -774,7 +774,7 @@ export class DynamicFormBase extends React.Component<
774774
const { useModernTaxonomyPicker } = this.props;
775775
// Init new value(s)
776776
field.newValue = newValue;
777-
field.stringValue = newValue.toString();
777+
field.stringValue = newValue? newValue.toString():'';
778778
field.additionalData = additionalData;
779779
field.subPropertyValues = {};
780780

‎src/controls/dynamicForm/dynamicField/DynamicField.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ export class DynamicFieldBase extends React.Component<IDynamicFieldProps, IDynam
353353
onSelectDate={(newDate) => { this.onChange(newDate, true); }}
354354
disabled={disabled}
355355
firstDayOfWeek={firstDayOfWeek}
356+
allowTextInput={true}
356357
/>}
357358
{
358359
dateFormat === 'DateTime' &&
@@ -364,6 +365,7 @@ export class DynamicFieldBase extends React.Component<IDynamicFieldProps, IDynam
364365
onChange={(newDate) => { this.onChange(newDate, true); }}
365366
disabled={disabled}
366367
firstDayOfWeek={firstDayOfWeek}
368+
allowTextInput={true}
367369
/>
368370
}
369371
{descriptionEl}

0 commit comments

Comments
 (0)
Please sign in to comment.