Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repair Editing a comment containing both RTL and LTR characters breaks the (edited) text #9834

Merged
merged 13 commits into from
Jul 25, 2022
26 changes: 14 additions & 12 deletions src/pages/home/report/ReportActionItemFragment.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,20 +104,22 @@ const ReportActionItemFragment = (props) => {
html={`<comment>${props.fragment.html + (props.fragment.isEdited ? '<edited></edited>' : '')}</comment>`}
/>
) : (
<Text
selectable={!canUseTouchScreen() || !props.isSmallScreenWidth}
style={EmojiUtils.containsOnlyEmojis(props.fragment.text) ? styles.onlyEmojisText : undefined}
>
{Str.htmlDecode(props.fragment.text)}
<View style={[styles.flexRow, styles.alignItemsBaseline]}>
Copy link
Member

@rushatgabhane rushatgabhane Jul 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Karim-30 unfortunately, justifyContent: baseline doesn't work well for a multiline message

image

Paste this message and edit it - "pen app on webPost(if not) some code block message with long lines so that it overflows.Try to move two finger (scroll) not precisely horizontally but at some other angle eg. 45Expected Result:
We have to precisely scroll to left or right or else the page will also scroll vertically."

Copy link
Contributor Author

@Karim-30 Karim-30 Jul 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated, here how it looks like :

web :

web2.mov

mweb :

mweb2.mov

android :

android2.mov

ios :

Ios2.mov

desktop :

Desktop2.mov

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Karim-30 code keeps changing, so it isn't necessary to add updated screenshots :)

<Text
selectable={!canUseTouchScreen() || !props.isSmallScreenWidth}
style={EmojiUtils.containsOnlyEmojis(props.fragment.text) ? styles.onlyEmojisText : undefined}
>
{Str.htmlDecode(props.fragment.text)}
</Text>
{props.fragment.isEdited && (
<Text
fontSize={variables.fontSizeSmall}
color={themeColors.textSupporting}
>
{` ${props.translate('reportActionCompose.edited')}`}
</Text>
<Text
fontSize={variables.fontSizeSmall}
color={themeColors.textSupporting}
>
{` ${props.translate('reportActionCompose.edited')}`}
</Text>
)}
</Text>
</View>
);
}
case 'TEXT':
Expand Down