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
668 stars 45 forks source link

Fix showing wrongly formatted text #374

Open zfurtak opened 3 weeks ago

zfurtak commented 3 weeks ago

Details

When typing text with command + b or command + i or command + u effect was applied to inputted text, which was unwanted. Also connected issue: when text was pasted to an empty filed, it was in the colour of placeholder. In these cases instead of <span> object with text, <b>, <i>, <u>.... was being created.

My proposal is to change the created object when it's not <span>

zfurtak commented 1 week ago

@BartoszGrajdek I agree this solution is much more clear but it leaves unwanted behaviour connected to placeholder. Look below how it looks in the example app and Expensify App. Or maybe we don't want to target this issue here?

https://github.com/Expensify/react-native-live-markdown/assets/92310164/833107c8-0e04-4c40-900a-9d1b46cb1039

https://github.com/Expensify/react-native-live-markdown/assets/92310164/e64f5efd-1d74-48fb-a74b-43a9658d88c0

BartoszGrajdek commented 1 week ago

We'll merge it after a version bump in E/App. To make sure in case of any regressions we don't have to add testing steps for this PR as well