mui/material-ui-pickers

DatePicker Value issue

hemanth307 opened this issue · 1 comments

**<LocalizationProvider dateAdapter={LuxonUtils} locale={locale}>
            <DatePicker
              OpenPickerButtonProps={{
                'id': 'FilterValue',
              }}
              inputFormat={format}
              showToolbar={false}
              value={rowData.value}
              onChange={(e: any) => {
                onColumnValueChange(e, rowData.id, "value");
              }}
              onError={(reason: any, value: any) => {
                if (value === null || value === "") {
                  setFilterDateHelpText("Required");
                }
                else if (reason !== null && reason !== "") {
                  switch (reason) {
                    case "invalidDate":
                      setFilterDateHelpText("Required");
                      break;
                  }
                }
                else {
                  setFilterDateHelpText("");
                }
              }}
              renderInput={props =>
                <TextField
                  {...props}
                  id="AdvancedFilterValue"
                  aria-label="Required"
                  inputProps={{ ...props.inputProps, 'aria-label': "Required", "placeholder": format }}
                  error={
                    props.error || rowData.value === null || rowData.value === ""
                  }
                  helperText={filterDateHelpText !== "" ? filterDateHelpText : props.helperText}
                />
              }
            />
          </LocalizationProvider>**
          
  1. I have a row with different columns and this datepicker component gets rendered on selection of values in any column, so initially it is showing "Required" and if i select a value in the datepicker the "required" is vanishing and then if i change any other column the required option in the datepicker is appearing but the datepicker still has a date in the textfield. so when i debug by changing anyother column the datepicker is getting triggered and the OnError is also getting triggerd and the value is null and the "required" option is appearing, but the value in the textfield is still there.

  2. Also if i clear the date field the "required" is appearing and if i select date again the "required" is not vanishing, it's still there.

Hello @hemanth307. This package has long been out of maintenance.
Please find the important information here.
We highly encourage you to start using @mui/x-date-pickers.
You can start here, then migrate to @mui/x-date-pickers@v5 using this guide and consider spending time to bump your usage to at least v6 (current LTS) with this guide.