-
Notifications
You must be signed in to change notification settings - Fork 398
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
Docs: Add Section with Solution for "double picker opening" bug #507
Docs: Add Section with Solution for "double picker opening" bug #507
Conversation
Based on the issue and the discussion, some approaches can be used. The most common approach is described at README.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @caiangums , thanks for improving the docs 🙌
Since the touchable + input part is not really related to the issue itself, can we mention only the part where we set the visibility to false first and then set the value? Or just linking the right answer in the thread would be cool too 👍
@mmazzarolo Thanks for your quick review! Even tho the "bug" happens in Android, it is a common thing happening with the usage of Example of solution using Input + DatePicker
The most common approach for solving this when using an
const [isVisible, setVisible] = useState(false);
const [date, setDate] = useState('');
<TouchableOpacity
activeOpaticy={1}
onPress={() => setVisible(true)}>
<Input
value={value}
editable={false} // optional
/>
</TouchableOpacity>
<DatePicker
isVisible={isVisible}
onConfirm={(date) => {
setVisible(false); // <- first thing
setValue(parseDate(date));
}}
onCancel={() => setVisible(false)}
/> What do you think? 😄 |
The main thing I would add and highlight is that the source of the community picker bug is that, in Android, you should first hide the modal and then use/read the picked date (correct me if I'm wrong) -- regardless of using an |
This adds solution description for an issue described and commonly searched that is not related to the lib itself, but to one of its dependencies. It also adds an example of usage with `<Input />` component and how to solve it.
Makes total sense! I changed the description and linked the reply. I also added the example using Thanks for all your feedback and help! 😌 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! 🙌 thanks for your contribution @caiangums :)
🎉 This PR is included in version 9.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Overview
Based on the issue and the discussion, some approaches can be used. The most common approach is described at README with this PR.
Test Plan
No Test needed! Just Docs update 😄