-
Notifications
You must be signed in to change notification settings - Fork 90
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
DatePicker Calendar is not shown when clicking on the Icon when using MediaInput as a trigger #1308
Comments
This can be helpful, from my investigation, I see that in file https://github.com/zendeskgarden/react-components/blob/main/packages/datepickers/src/elements/Datepicker/Datepicker.tsx - Line 202
This ref and the condition for it are showing the Calendar only on clicking on the Input element itself, to not open the Calendar when clicking on the Wrapper that also include the Label, this may be changed to include any click in the field wrapper including the icons and ignoring only the outer content like Label |
Hi @abdallahzakzouk. I removed the And of course, if things come up and let us know. We can add this one to our team's backlog. 👍 |
After looking into this, we added this issue into our backlog for Garden attention. Thanks for reporting this! 👏 |
I double checked and yes you are right, I found that it should be handled from MediaInput component, not from DatePicker Thank you Michael for your consideration :) |
The only child provided to <Field>
<Label>{Datepicker.displayName}</Label>
<Datepicker {...args} formatDate={formatDate} isCompact={isCompact} refKey="wrapperRef">
<MediaInput
end={<Icon />}
isCompact={isCompact}
wrapperProps={{ style: { width: isCompact ? 256 : 320 } }}
/>
</Datepicker>
</Field> But this only gets us part-way there. The Garden react-components/packages/datepickers/src/elements/Datepicker/Datepicker.tsx Lines 189 to 192 in 1d5b1df
Local testing bears out this solution. But more would need to be done to thoroughly unit test and also check |
If we determine that double-dipping on |
Thank you @jzempel for your investigation, I think having an extra prop to be used when needed is a good approach if it's not possible to force the behaviour for all cases, please let me if know if something is needed from my side to help doing this change :) |
Expectations
Given a usage of Media Input inside a Date Picker as a trigger input, and having an icon as End, Start, or both,
When I click on the Icon, I am expecting the input to be focused and the Calendar to be shown
Reality
On the previous scenario the Input is focused correctly, but the calendar is NOT shown
Steps to Reproduce
Codesandbox Example,
Fine Print
The text was updated successfully, but these errors were encountered: