Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple = {false} not working #25

Closed
sharan98727 opened this issue Mar 18, 2021 · 2 comments
Closed

multiple = {false} not working #25

sharan98727 opened this issue Mar 18, 2021 · 2 comments

Comments

@sharan98727
Copy link

const FormMultipleDatePicker: FunctionComponent = ({
displayName, name, placeholder, menuPortalTarget, minDate, maxDate,
className="", asterisk = true, variant="", isEdit, isMultiDatePickerDisabled = false,
placeHolderText = ""
}) => {
const {errors, control} = useFormContext();
// @ts-ignore
return <FlexColumn className={className + " px-2 mb-3"}>
{displayName}{asterisk? * :''}

<Controller
control={control}
name={name}
placeholder={placeholder}
menuPortalTarget={menuPortalTarget}
render={({onChange, value}) => (
isEdit ?
:

)}
/>

{errors[name] && errors[name].message}

};

in this code if i put multiple={false} the date picker is still allowing user to select multiple dates. is this a bug in the library itself. iam using datepicker with react-hookforms and controller

@shahabyazdi
Copy link
Owner

shahabyazdi commented Mar 18, 2021

What type of value do you enter to DatePicker as initial value? If type of initial value is array, even if you set multiple to false., The DatePicker considers multiple to true.

@shahabyazdi
Copy link
Owner

I'm going to close this issue .
If you still have any problem related to this issue please reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants