`markdownStyle` updates to `emoji.fontSize` aren't applied right away on iOS
Problem
The markdownStyles-> emoji -> fontSize update doesn't re-render the input on iOS.
So any time new value is passed as emoji fontSize it's not applied right away, it works only after the input value is updated (something new got entered).
Steps to reproduce
- Update App.tsx example with the next updates:
// Specify default markdownStyle value
const [markdownStyle, setMarkdownStyle] = React.useState({emoji: {fontSize: 19}});
// Display markdownStyles to see how it's updated
<Text>Markdown style: {JSON.stringify(markdownStyle)}</Text>
...
// Add two buttons to update emoji font size
<Button
title="Update emoji font size to 27"
onPress={() =>
setMarkdownStyle({
emoji: {
fontSize: 27,
},
})
}
/>
<Button
title="Update emoji font size to 19"
onPress={() =>
setMarkdownStyle({
emoji: {
fontSize: 19,
},
})
}
/>
- Enter a couple of emojis and some text in the input
- Tap on buttons to update the emoji font size. See that the value inside markdownStyles is updated but it has no effect on the input. Enter a new chart to the input, the updated styles will be applied now.
https://github.com/user-attachments/assets/3b549332-cf14-40ce-9d65-8c3e302f8bbc
Platform
iOS
^^ @parasharrajat
@tomekzaw Hi, I see you were working on the markdownStyles feature. Do you have the capacity to take a look at the issue or maybe you can at least share some thoughts to start with? This bug affects the enlarged emojis implementation.
@tomekzaw @parasharrajat I've created a Draft PR with a fix for this issue. I'm going to test it over the E/App tomorrow and if everything is ok open the PR for the review.
I've noticed the fix also exists in this PR, but for some reason it wasn't progressed since May. @tomekzaw is there any reason for it?
Fixed in https://github.com/Expensify/react-native-live-markdown/pull/475