chakra-datepicker
chakra-datepicker copied to clipboard
Feature: Custom PopoverTrigger
Could we allow a custom PopoverTrigger? If the prop isn't passed in, it defaults to the current input. Example code:
export const Example = () => <DatePicker value={new Date()} popoverTrigger={() => <Button>New Date</Button>} />
I can submit a PR today. The code changes should be as simple as wrapping the current trigger with a conditional. Example:
<PopoverTrigger>
{popoverTrigger ? (
{popoverTrigger?.()}
) : (
<Input
size="lg"
value={value}
onFocus={onFocus}
onChange={onChange}
/>
)}
</PopoverTrigger>