feat: custom selection color#250
Conversation
hryhoriiK97
left a comment
There was a problem hiding this comment.
Thanks for the PR! It's a great addition to enriched-markdown 🙌 ❤️
Before going further on implementation details, I'd like to propose simplifying the API.
react-native-enriched solves the same problem with a single selectionColor prop, explicitly aligning with React Native's convention (TextInput also exposes only selectionColor — no selectionHandleColor).
We'd like to match that pattern here. I recommend checking their implementation for reference.
|
@hryhoriiK97 Thank you for the review! ❤️
I'm pretty new to React Native, so I could be wrong. The React Native doc does mention the In Android, the handler color matches the selection color precisely, but the selection color needs to be much lighter for the underlying text to be shown properly. iOS has the computation done automatically, but Android doesn't. Basically, I'm trying to make the experience look similar in iOS and Android. Set Set
|
@xindixu thank you for catching this! I'd totally missed this prop. In that case, let's go with this:
|
|
@hryhoriiK97 Updated based on your review! PTAL. Thanks! |
hryhoriiK97
left a comment
There was a problem hiding this comment.
@xindixu I’ve done an initial review and left a few comments 🙂
2fb32c5 to
90edd78
Compare
|
@hryhoriiK97 thank you for the detailed review! I've addressed all your feedback. New tests: iOS: ios.selection.color.movAndroid: android.selection.color.mov |
hryhoriiK97
left a comment
There was a problem hiding this comment.
Thank you for addressing all the comments! A few additional ones from me 🙏
4628d7b to
6972ae2
Compare
|
@hryhoriiK97 Addressed all your feedback. PTAL! Built android app again and verified that it works as expected
|
hryhoriiK97
left a comment
There was a problem hiding this comment.
Thanks for the contribution! 🚀 A few things still worth improving 0 I'll handle those in follow-up PRs to keep this PR's scope focused. selectionColor will be available in tomorrow's nightly release.





What/Why?
Add support for custom selection color to the
<EnrichedMarkdownText />component. Added 2 props:selectionColorandselectionHandleColor. See React Native doc:https://reactnative.dev/docs/textinput#selectioncolor and https://reactnative.dev/docs/textinput#selectioncolor for more detail
Testing
Test with selecting text in both ios and android.
Screenshots
PR Checklist