improvement: avoid two taps requirement for android #51
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds
keyboardShouldPersistTaps
withhandled
as default value to improve usability in some cases like having focus in an input, but needs two taps to interact with pressable components like buttons, sliders and switchs.To clarify the issue, I record 2 videos:
without
keyboardShouldPersistTaps
We needs two taps, 1 for keyboard dismiss and another one to interact with pressable.
without-keyboardShouldPersistTaps.mp4
with
keyboardShouldPersistTaps
ashandled
Here we need only 1 tap to interact with pressable.
with-keyboardShouldPersistTaps-as-handled.mp4
Related Issues
resolves #29
Tests
Don't need new tests1, only a snapshot update. But to tests in your computer, you can use the MansoryExample App.tsx patch below:
MasonryExample/src/App.tsx.patch
Checklist
Before you create this PR confirms that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.yarn lint && yarn tsc
yarn test
oryarn test -u
if you need to update snapshot.Footnotes
I update some tests that don't requires to be async. ↩