-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[$1000] Web - Profile - The text on the modal Drag, zoom, and rotate your image to your preferred is highlighted when rotate the picture the picture #14139
Comments
My first few of these, so taking the template from StackOverflowTeams: https://stackoverflowteams.com/c/expensify/questions/14418
I don't really understand this issue. If I highlight some text, and then click somewhere else in the app, the text should be unhighlighted shouldn't it? The focus has moved, in this case, to the rotate option. |
Ah wait, I see now. It just randomly highlights it whenever you click rotate: 2023-01-11_12-06-22.mp4https://expensify.slack.com/archives/C01GTK53T8Q/p1673438611054609 - making this |
Job added to Upwork: https://www.upwork.com/jobs/~012de3dfcd27f5f324 |
Current assignee @twisterdotcom is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mollfpr ( |
Triggered auto assignment to @danieldoglas ( |
ProposalProblemThe clicking action was triggered for the wrapper div component, causing the text in the div to be highlighted SolutionDisable user select in the text and the menu diff --git a/src/components/AvatarCropModal/AvatarCropModal.js b/src/components/AvatarCropModal/AvatarCropModal.js
index 1d9922ead4..a024e3b079 100644
--- a/src/components/AvatarCropModal/AvatarCropModal.js
+++ b/src/components/AvatarCropModal/AvatarCropModal.js
@@ -316,7 +316,7 @@ const AvatarCropModal = (props) => {
title={props.translate('avatarCropModal.title')}
onCloseButtonPress={props.onClose}
/>
- <Text style={[styles.mh5]}>{props.translate('avatarCropModal.description')}</Text>
+ <Text style={[styles.mh5, styles.userSelectNone]}>{props.translate('avatarCropModal.description')}</Text>
<GestureHandlerRootView onLayout={initializeImageContainer} style={[styles.alignSelfStretch, styles.m5, styles.flex1, styles.alignItemsCenter]}>
{/* To avoid layout shift we should hide this component until the image container & image is initialized */}
diff --git a/src/components/HeaderWithCloseButton.js b/src/components/HeaderWithCloseButton.js
index ee1970bca3..9df1cbb204 100755
--- a/src/components/HeaderWithCloseButton.js
+++ b/src/components/HeaderWithCloseButton.js
@@ -136,6 +136,7 @@ class HeaderWithCloseButton extends Component {
styles.flexGrow1,
styles.justifyContentBetween,
styles.overflowHidden,
+ styles.userSelectNone
]}
>
{this.props.shouldShowBackButton && ( recordfix_100123_selectext.mp4 |
@tienifr we cannot use userSelectNone as it will create following regression: This issue can be fixed by same solution as posted for another issue: |
I agree the text should be selectable. @jatinsonijs I feel your proposal to complicated. This issue can be fixed with a slight change. |
@mollfpr understood your concern, diff --git a/src/components/AvatarCropModal/AvatarCropModal.js b/src/components/AvatarCropModal/AvatarCropModal.js
index 1d9922ead4..a6ad8309c9 100644
--- a/src/components/AvatarCropModal/AvatarCropModal.js
+++ b/src/components/AvatarCropModal/AvatarCropModal.js
@@ -348,7 +348,7 @@ const AvatarCropModal = (props) => {
icon={Expensicons.Rotate}
iconFill={themeColors.inverse}
iconStyles={[styles.mr0]}
- style={[styles.imageCropRotateButton]}
+ style={[styles.imageCropRotateButton, styles.userSelectNone]}
onPress={rotateImage}
/>
</View> |
@jatinsonijs Could you explain why the issue happen and why your solution is to fix the issue? |
@mollfpr it is default behaviour of browsers whenever we do double click text get selected. With userSelectNone we are preventing this behaviour on particular div. as in our app we are using custom button which is actually a div internally. On div its default behaviour of browsers. as per browser implementation it is prevented internally at browser level like on image db-press, native web buttons, anchor tag and some other elements. |
Proposal I believe this is because of We can fix this by adding It might be worth fixing this by adding |
Thanks @jatinsonijs!
It is only reproducible on the button using an icon.
I agree with this, can you confirm that adding @twisterdotcom Do you think this should be closed to like @Puneet-here attached? |
Proposaldiff --git a/src/components/Button.js b/src/components/Button.js
index 6e6fbade77..e7689a7066 100644
--- a/src/components/Button.js
+++ b/src/components/Button.js
@@ -181,7 +181,6 @@ class Button extends Component {
const textComponent = (
<Text
- selectable={false}
style={[
this.props.isLoading && styles.opacity0,
styles.pointerEventsNone,
@@ -255,6 +254,7 @@ class Button extends Component {
disabled={this.props.isLoading || this.props.isDisabled}
style={[
this.props.isDisabled ? {...styles.cursorDisabled, ...styles.noSelect} : {},
+ styles.userSelectNone,
styles.buttonContainer,
this.props.shouldRemoveRightBorderRadius ? styles.noRightBorderRadius : undefined,
this.props.shouldRemoveLeftBorderRadius ? styles.noLeftBorderRadius : undefined, Instead of adding the |
@s77rt Removing |
@jatinsonijs Yes, but since it's a reusable component we can prevent the same issue occur in the future. Toggled button with an icon will not only be for the avatar modal but could be anywhere. |
Still HELD |
Held, but not for long! |
Still held on #31381 |
Looks like this can come off HOLD |
Here is a solution #14139 (comment) which can be implemented now. |
@parasharrajat you wanna be assigned? @mollfpr if you agree and Rajat is down, can we just assign him? |
IMO, It was already added in a lot of places. Can we retest this issue? |
I'll retest the issue 👍 |
I think this issue was already fixed! Screen.Recording.2024-01-26.at.00.15.29.mp4Although, the highlight remains, but I think it's expected. I do the same with a new project; it keeps the highlight on the text after pressing a button. |
That seems like a different thing. We might be blocking the default click behavior causing the static selection. This does not seem like a major thing. We should be good to close this issue. @twisterdotcom |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
HOLD on #16660
Issue found when executing PR #14115
Action Performed:
Expected Result:
The text on the modal Drag, zoom, and rotate your image to your preferred is not highlighted when rotate the picture
Actual Result:
The text on the modal Drag, zoom, and rotate your image to your preferred is highlighted when rotate the picture
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.2.50.14
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Recording.1971.mp4
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: