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
[HOLD for payment 2023-01-30] [$4000] Mac / Safari - Cursor Pointer changes to I-beam while dragging image or slider knob in edit photo. #13688
Comments
Triggered auto assignment to @puneetlath ( |
Current assignee @puneetlath is eligible for the External assigner, not assigning anyone new. |
Job added to Upwork: https://www.upwork.com/jobs/~01ba623ffe6500b581 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @aimane-chnaif ( |
Current assignee @puneetlath is eligible for the External assigner, not assigning anyone new. |
The issue was reported by @Tushu17 (not me) |
Thank you. proposalWe need to disable selection when dragging for that can add App/src/components/AvatarCropModal/AvatarCropModal.js Lines 110 to 112 in b0f6785
|
Proposaldiff --git a/src/components/AvatarCropModal/AvatarCropModal.js b/src/components/AvatarCropModal/AvatarCropModal.js
index a42da9901c..84e663ee83 100644
--- a/src/components/AvatarCropModal/AvatarCropModal.js
+++ b/src/components/AvatarCropModal/AvatarCropModal.js
@@ -338,7 +338,13 @@ const AvatarCropModal = (props) => {
<Pressable
style={[styles.mh5, styles.flex1]}
onLayout={initializeSliderContainer}
- onPressIn={e => runOnUI(sliderOnPress)(e.nativeEvent.locationX)}
+ onPressIn={e => {
+ runOnUI(sliderOnPress)(e.nativeEvent.locationX);
+ document.onselectstart = function(){ return false;}
+ }}
+ onPressOut={()=>{
+ document.onselectstart = function(){ return true; }
+ }}
>
<Slider sliderValue={translateSlider} onGesture={panSliderGestureEventHandler} />
</Pressable> Result Screen.Recording.2022-12-19.at.10.08.23.AM.mp4since it disables the whole selection drag in the entire page, we need to re enable it after the press is lifted. Without applying onPressOut
Screen.Recording.2022-12-19.at.10.15.49.AM.movAlso Noticed that In this case we can apply the solution separately using + onPress={() => {
+ document.onselectstart = function(){ return false;}
+ }}
|
Proposal :- Along with slider we need to disable selection on diff --git a/src/components/AvatarCropModal/AvatarCropModal.js b/src/components/AvatarCropModal/AvatarCropModal.js
index a42da9901..1250c877c 100644
--- a/src/components/AvatarCropModal/AvatarCropModal.js
+++ b/src/components/AvatarCropModal/AvatarCropModal.js
@@ -210,6 +210,8 @@ const AvatarCropModal = (props) => {
// eslint-disable-next-line no-param-reassign
context.translateSliderX = translateSlider.value;
isPressableEnabled.value = false;
+
+ document.onselectstart = function(){ return false;}
},
onActive: (event, context) => {
const newSliderValue = clamp(event.translationX + context.translateSliderX, [0, sliderContainerSize]);
@@ -222,9 +224,15 @@ const AvatarCropModal = (props) => {
const newX = translateX.value * differential;
const newY = translateY.value * differential;
+
+ document.onselectstart = function(){ return false;}
+
updateImageOffset(newX, newY);
},
- onEnd: () => isPressableEnabled.value = true,
+ onEnd: () => {
+ document.onselectstart = function(){ return true;}
+ isPressableEnabled.value = true
+ },
}, [imageContainerSize, clamp, translateX, translateY, translateSlider, scale, sliderContainerSize, isPressableEnabled]);
// This effect is needed to prevent the incorrect position of
@@ -338,7 +346,13 @@ const AvatarCropModal = (props) => {
<Pressable
style={[styles.mh5, styles.flex1]}
onLayout={initializeSliderContainer}
- onPressIn={e => runOnUI(sliderOnPress)(e.nativeEvent.locationX)}
+ onPressIn={e => {
+ runOnUI(sliderOnPress)(e.nativeEvent.locationX)
+ document.onselectstart = function(){ return false;}
+ }}
+ onPressOut={() => {
+ document.onselectstart = function(){ return true;}
+ }}
>
<Slider sliderValue={translateSlider} onGesture={panSliderGestureEventHandler} />
</Pressable> |
PROPOSALWe just need to add the following line of code in Code changes will be here after the Lines 23 to 25 in 3e050bd
Please see this link for more info. After the fixScreen.Recording.2022-12-20.at.1.08.34.AM.mov |
This comment was marked as outdated.
This comment was marked as outdated.
@jatinsonijs The approach of using
However, your proposal is still not that good as it will disable the selection on the entire screen as long as the crop modal is visible. The selection should be disabled only when dragging. |
This comment was marked as outdated.
This comment was marked as outdated.
@jatinsonijs The code looks much better now, can you just double check if this works all the time ( |
Yes I have tested it working fine |
@jatinsonijs I'm not a C+ but you have my vote. |
@aimane-chnaif thoughts on these proposals? |
reviewing today |
In @jatinsonijs 's proposal 1: In @jatinsonijs 's proposal 2: And I gave all other proposals 👎 directly because they cause regressions on native apps or text selection. So no acceptable solutions so far. |
Oh, no worries. I like the latter simply because this's exactly the scenario it's used in. 😂 As I explained before: // During selection, use an I-beam regardless of the content beneath the cursor.
// If a drag may be starting or we're capturing mouse events for a particular node, don't treat this as a selection.
if (m_mousePressed
&& mouseDownMayStartSelect()
#if ENABLE(DRAG_SUPPORT)
&& !m_mouseDownMayStartDrag
#endif
&& m_frame.selection().isCaretOrRange()
&& !m_capturingMouseEventsElement)
return iBeam;
They can all break the conditions here, the difference is only in their meaning. The former means disabling the select feature, it does have better compatibility. The latter is more suitable for dragging scenes, but it's implemented since safari 13.
Footnotes |
@puneetlath Do you mind providing your take based @aimane-chnaif's recent review and the more recent commentary? |
Sorry for the delay! I reached out to software mansion to get their perspective. Will make a decision within the next day or two depending on their response. |
SWM said they’d get back to me tomorrow about how long they think their experimental web implementation will stay “experimental”. Based on that, we can decide the path forward. |
@puneetlath It will come up with other changes as well, which will impact various part of app. As react-native-gesture handler used on other area as well for example in react-navigation, Scrollview etc... I think when we required same thing on another part then we should do these library changes. |
Looks like something related to As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our Feel free to drop a note in #expensify-open-source with any questions. |
Ok thanks for your patience everyone. Let's go ahead with @jatinsonijs proposal. |
📣 @jatinsonijs You have been assigned to this job by @puneetlath! |
@jatinsonijs can you please:
Thanks! |
Thanks @puneetlath applied, PR is ready for review |
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.2.57-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2023-01-30. 🎊 After the hold period, please check if any of the following need payment for this issue, and if so check them off after paying:
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
Paid @jatinsonijs and @aimane-chnaif. Just waiting for @thesahindia to accept offer for the reporting bonus. Then we're done. |
Ah cool. Thanks for correcting that! @Tushu17 can you please apply to this Upwork job: https://www.upwork.com/jobs/~01ba623ffe6500b581 |
@puneetlath Okay applied. Thank you. |
All paid. Thanks for your contribution everyone! |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:-
Expected Result:
Cursor should remain in pointer state while dragging.
Actual Result:
Cursor pointer changes to I-beam while dragging image or slider knob.
Workaround:
unknown
Platform:
Where is this issue occurring?
Version Number: 1.2.41-1
Reproducible in staging?: y
**Reproducible in production?:**y
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:
Screen.Recording.2022-12-17.at.1.22.46.AM.mov
Recording.29.mp4
Expensify/Expensify Issue URL:
Issue reported by: @Tushu17
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1671220553043089
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: