-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[pickers] input end adornment doesn't open date picker #24511
Comments
@jbojcic1 Interesting, I see two wrong assumptions:
I would propose two resolutions:
Would you like to have 4? |
@oliviertassinari yes 4 would be great. If I am not wrong InputProps was there in mui-pickers so I thought it will still be here and it worked so I used it. Also not sure if I missed it but I don't see date picker in the api section of https://next.material-ui.com/ so wasn't able to check exact api Btw why doesn't mobile date picker have the calendar icon by default? |
On desktop, the input is the primary interaction area, the calendar icon opens a popup for a second modality. |
Is anyone on this issue? If not can I take it? |
Can you clarify what you're trying to do? You can change the icon with <DatePicker
label="Basic example"
value={value}
onChange={(newValue) => {
setValue(newValue);
}}
renderInput={(params) => <TextField {...params} />}
+ openPickerIcon={<CalendarTodayIcon />}
/> If you want to listen to clicks on the open-picker-button you should be able to use <DatePicker
label="Basic example"
value={value}
onChange={(newValue) => {
setValue(newValue);
}}
renderInput={(params) => <TextField {...params} />}
openPickerIcon={<CalendarTodayIcon />}
+ OpenPickerButtonProps={{
+ onClick: () => console.log("click open picker button")
+ }}
/> However, @oliviertassinari I reverted your title change. Let's ask the issuer first what they want and dont put words in their mouth. |
From what I understand of this issue of @jbojcic1, the objective is to replace the icon to match its design specs. This can already be done using the right API ( However, there are two weird things, and we might want to push the solution further, hopefully avoiding other developers falling into it:
|
You did not do any such thing. Like please form an opinion first and then try to find a solution. This "I'm doing X" and then you come up with a justification is clearly not working for you. |
You are right, the tense is not correct. |
Closing as a solution was provided in #24511 (comment). |
@oliviertassinari @eps1lon so what I wanted is a way to have a custom datepicker icon and and that click/tap on it opens the datepicker |
@oliviertassinari as mentioned by @eps1lon |
Current Behavior 😯
When input adornment is used, click on it does nothing.
Expected Behavior 🤔
Click on input adornment should open date picker
Steps to Reproduce 🕹
Example https://codesandbox.io/s/material-ui-issue-forked-fg7b4?file=/src/Demo.js
Steps:
The text was updated successfully, but these errors were encountered: