Refactor date picker to be compatible with form#7627
Conversation
|
@sig5 videos for everything except mWeb aren't working, can you please reupload? I can only see a black screen. Edit: this is happening only on mobile devices. |
I believe this is the expected behaviour. |
|
Sorry for the misunderstanding, I meant that the |
|
@sig5 any updates? |
|
Hi @luacmartins, I was waiting for clarification on this thread : #7627 (comment) . We should be good to go once we reach a conclusion here :D |
|
@sig5 Sorry I missed that! Replied to it just now. Thanks for the reminder! |
|
@sig5 I addressed the pending comments. Let me know if there's anything else that I missed. Thanks! |
|
Thank you for addressing the comments @luacmartins :D. I think the PR should be ready for review now. |
There was a problem hiding this comment.
@sig5 please merge main into your branch, and adress the requested changes.
Thanks!
|
@sig5 when do you think you'll be able to address @rushatgabhane's comments? |
|
Hi @luacmartins, sorry I missed the notifications. I think I have addressed the comments mentioned by @rushatgabhane . |
luacmartins
left a comment
There was a problem hiding this comment.
Thanks for addressing @rushatgabhane's comments!
I'm not convinced that we need some of these additions, i.e. didComponentUpdate, value and selectedValue so I left a few more comments to try to understand this solution better.
luacmartins
left a comment
There was a problem hiding this comment.
Thanks for addressing my concerns @sig5!
I left a comment about renaming onChange handler.
While testing DatePicker outside the form, I noticed a strange behavior where the date gets wiped when typing it a second time (see video below). We should make sure that we are not breaking any current usages of it.
date.mov
| setDate(event, selectedDate) { | ||
| this.setState({isPickerVisible: false}); | ||
| if (event.type === 'set') { | ||
| this.props.onChange(selectedDate); |
There was a problem hiding this comment.
we renamed onChange to onInputChange passed down by the form, so we should update it accordingly within DatePicker and in all usages of DatePicker
There was a problem hiding this comment.
Sure thing! I will update it.
|
@sig5 bump to address @ luacmartins' comments |
|
@luacmartins , I can't reproduce it. |
|
@sig5 there is definitely something strange going on. Are you sure you can't repro this? Please let me know the details if so. (platform, steps, screenshot?) datepicker.mov |
|
@rushatgabhane could you please add the steps of reproduction? |
|
You can probably follow the videos, but something like:
|
|
@sig5 any updates? |
|
Hey @sig5, are there any updates here? |
|
Hey folks, I have been encountering some health issues for a while due to which I am unable to allocateenough time for the issues, even after trying my best. The work in my PR's is approaching completion and interested individuals can fork my branch and continue working on it. Thanks. |
|
Thanks for the update @sig5 and I'm sorry to hear that. I'll pick up the issue to push this project forward. Thank you so much! |
|
Closing this PR in favor of #8770 |
Details
Importing the
baseTextInputPropTypesdoes the deal. I have added apropTypefor defaultValue to support both dates and strings as consistency in the value and defaultValue parameter is expected.The
valueprop is not a required prop.Done!
Importing the
baseTextInputPropTypesdoes the deal.Done! Strangely it hadn't been implemented for TextInput in the PR.
Done! Ref has been passed to TextInput elements because DatePicker doesn't natively support focus. These are handled via different methods. t
his.textInput.clear()and similar methods are accessibleDone!
Done!
There are a few more discretionary changes done. I will mention those in the comments.
Newly discovered Issues:
1.The
datepickerdoesn't get focussed on clicking in android/iOS.2. The storybook sidebar UI styling is broken for mWeb.
Fixed Issues
$ #7536
Tests
Run the app and test that DatePicker still works fine.
The errors observed were common to
TextInput. Resolution of those should rectify the ones that appear here.QA Steps
Tested On
Screenshots
Web
Kazam_screencast_00007.mp4
Mobile Web
WhatsApp.Video.2022-02-08.at.11.49.17.AM.mp4
Desktop
Kazam_screencast_00004.mp4
iOS
Kazam_screencast_00003.mp4
Android
Kazam_screencast_00002.mp4