Expensify / react-native-live-markdown

Drop-in replacement for React Native's TextInput component with Markdown formatting.
https://www.npmjs.com/package/@expensify/react-native-live-markdown
MIT License
787 stars 56 forks source link

fix: use setBaseAndExtent instead of removeAllRanges #357

Closed dominictb closed 4 months ago

dominictb commented 4 months ago

Details

Use selection.setBaseAndExtent instead of selection.removeAllRanges(); selection.addRange(range) to avoid the keyboard on Android chrome to hide

Related Issues

$ https://github.com/Expensify/App/issues/41137 PROPOSAL: https://github.com/Expensify/App/issues/41137#issuecomment-2121656214

Manual Tests

Use Android chrome and go to the main page https://127.0.0.1:8082 Tap on a report Paste any text repeatedly and note the page

Expected: The keyboard should remain open and visible after the paste. Also, the caret position must be maintained.

Linked PRs

https://github.com/Expensify/App/pull/42622

github-actions[bot] commented 4 months ago

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

dominictb commented 4 months ago

I have read the CLA Document and I hereby sign the CLA

dominictb commented 4 months ago

recheck

tomekzaw commented 4 months ago

@dominictb Thanks for the PR! We'll review it soon

dominictb commented 4 months ago

@Skalakid could you help approve? Tks!