Skip to content

Commit

Permalink
Merge pull request #19798 from kushu7/fix-19605
Browse files Browse the repository at this point in the history
fix editing just emoji cuts top part android
  • Loading branch information
cristipaval authored Jun 2, 2023
2 parents d8b1d84 + d81b8a7 commit 8acc630
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pages/home/report/ReportActionItemFragment.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,13 @@ const ReportActionItemFragment = (props) => {

return <RenderHTML html={props.source === 'email' ? `<email-comment>${htmlContent}</email-comment>` : `<comment>${htmlContent}</comment>`} />;
}
const containsOnlyEmojis = EmojiUtils.containsOnlyEmojis(text);

return (
<Text
family="EMOJI_TEXT_FONT"
selectable={!DeviceCapabilities.canUseTouchScreen() || !props.isSmallScreenWidth}
style={[EmojiUtils.containsOnlyEmojis(text) ? styles.onlyEmojisText : undefined, styles.ltr, ...props.style]}
style={[containsOnlyEmojis ? styles.onlyEmojisText : undefined, styles.ltr, ...props.style]}
>
{convertToLTR(Str.htmlDecode(text))}
{Boolean(props.fragment.isEdited) && (
Expand All @@ -129,7 +131,7 @@ const ReportActionItemFragment = (props) => {
>
<Text
selectable={false}
style={[styles.w1, styles.userSelectNone]}
style={[containsOnlyEmojis ? styles.onlyEmojisTextLineHeight : undefined, styles.w1, styles.userSelectNone]}
>
{' '}
</Text>
Expand Down
4 changes: 4 additions & 0 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,10 @@ const styles = {
lineHeight: variables.fontSizeOnlyEmojisHeight,
},

onlyEmojisTextLineHeight: {
lineHeight: variables.fontSizeOnlyEmojisHeight,
},

createMenuPositionSidebar: (windowHeight) => ({
horizontal: 18,
vertical: windowHeight - 100,
Expand Down

0 comments on commit 8acc630

Please sign in to comment.