react-native-paper-dates
react-native-paper-dates copied to clipboard
Is there any way to eliminate the writing field in DatePickerModal?
DatePickerModal componen allows the mobile user to write the date on themselves. I would like to know if there's an chance that I could stop that from happening. Maybe with a property?
Why? What are you worried for? You can provide a min and max ad validRange and the component will always return valid dates otherwise the old date is used
I am getting errors and my app restarts when I write on it. I would like to have an option to disable that field.
We should fix that then, what version are you on? We fixed it in v4+ the app should not crash anymore.
yeah but I keep updating the library and still get the same issue. so it would help me if I could disable the field. Is it possible?. I am using 0.4.0, now I updated to 0.4.1 but to no avail. I still have that problem.
I don’t want to disable it I want to fix the the root issue. What is the date you are filling in and which platform, which timezone and which locale are you in?
Op vr 19 mrt. 2021 om 12:39 schreef María Palacios @.***
yeah but I keep updating the library and still get the same issue. so it would help me if I could disable the field. Is it possible?
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/web-ridge/react-native-paper-dates/issues/59#issuecomment-802771779, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRRARKONCIK5PNML6UV3I3TEMZXDANCNFSM4ZNH5D3Q .
--
Richard Lindhout | Eigenaar Bel mij +31 6 43 42 45 67 <+31643424567>
Beatrixlaan 2, 4694EG Scherpenisse
KVK 56845367 BTW NL002365659B60 IBAN NL93 BUNQ 2038 9661 33 WEB webRidge.nl https://webRidge.nl
ah I'm validating it with momentjs I don't know if it has something to do with it
Try to debug with console.log() before you check with momentJS, maybe it crashes before. Can you trigger the issue on reactnativepaperdates.com?
No, it crashes while writing. I did a console.log() and it crashes while I write the date
how would the dateRange validation be in that case?
dateRange validation is here: https://github.com/web-ridge/react-native-paper-dates/blob/d783ee57cc9efff93692810fe9e17086946be25c/src/Date/dateUtils.tsx#L107
Also bumped into this problem. Was able to recreate it on reactnativepaperdates.com
Steps:
- click pick a single date
- click the edit icon
- in the input, navigate with cursor onto year 2021, between 20 and 21
- write a
/character
Browser logs Uncaught TypeError: Cannot read property 'length' of undefined.
iOS simulator freezes.
Android emulator restarts the app.
(simulators were tested on a project and not reactnativepaperdates.com, but we get the same error in the browser and not doing anything fancy that could cause this).
Screencast showcasing the issue: https://www.screencast.com/t/O3cEYZCG
This is indeed an edge case, but can happen.
I'll fix the crashing issue within 2 weeks!
@RichardLindhout Is it possible to keep this configurable? Basically my UX team wants to use this picker, but they don't want the edit button at the top. I understand it's your concept and you would like it to work properly. But it can be helpful if there is a flag which prevents the display of edit button. Something on the lines of disableManualEntry which can be false by default, so only people who actually need to disable it can do so.
@RichardLindhout any update on this please?
Hey I'm really sorry I'm really short on time a.t.m. but would be fine if we can disable this with a prop, but I want to fix the crash first not disabling first
Thanks for the PR @ airam666, can you maybe please also check how to prevent the crash with wrong dates and update the PR. I'll merge it then!