[英]onClose, react-date-presets returns undefined startDate, endDate, when pick a range. OK if select custom-range
If i select a custom range, the onClose correctly return startDate and endDate but if i pick one value from the ranges it will break since returns undefined.如果我 select 自定义范围,onClose 正确返回 startDate 和 endDate 但如果我从范围中选择一个值,它将中断,因为返回未定义。
I have to find a way to grab the updated startDate and endDate inside the onClose function also if i select one range.如果我在 select 一个范围内,我也必须找到一种方法来获取 onClose function 内更新的 startDate 和 endDate 。
Here the example: https://codesandbox.io/s/clever-shamir-gyi0m?file=/src/App.js这里的例子: https://codesandbox.io/s/clever-shamir-gyi0m?file=/src/App.js
Had to modify the library, you can find a fix for this here: https://github.com/Matteobikk90/react-dates-presets不得不修改库,你可以在这里找到一个修复: https://github.com/Matteobikk90/react-dates-presets
Essentially onClose were not sending the values(startDate, endDate) if the user was selecting a range.如果用户正在选择一个范围,则基本上 onClose 不会发送值(startDate,endDate)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.