REACT - MUI - Autocomplete - HelperText and Error


                    REACT - MUI - Autocomplete - HelperText and Error

 


As normal MUI Control HelperText and Error props are not available inside the AutoComplete Control. To achieve the same We have use TextField props


<Autocomplete 
            id="cboCountry"
            options={CountryList}
            getOptionLabel={(option) => option.countryName}
            getOptionValue={(option) => option.id} /
            value={CountrySelected}   
           size="small"           
            sx={{ width: 300 }}
            renderInput={(params) => (

              <TextField {...params} label="Country" 
                         required
                         helperText={"Vaue is required in Country}
                         error={true}
              />
            )}
            placeholder="Country"                                         
          />

Comments

Popular posts from this blog

Shared / Static Class in vb.net/C#

Xamarin Forms : PopUp Page with RG.Plugins.Popup

Text was truncated or one or more characters had no match in the target code page.". (SQL Server Import and Export Wizard)