-
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
Ishpaul777/rhn no dropzone #23528
Ishpaul777/rhn no dropzone #23528
Conversation
@robertKozik Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
@ishpaul777, ping me when you have completed the checklist and the PR will be ready for review. |
@robertKozik done! PR is ready. |
@robertKozik any updates? |
Sorry, I was focused on other issues. I'll address it tomorrow. |
BUG: when overing over RHN options with attachments, options are being highlighted (not reproducible on main) VIDEO: bug-rhn-highlightling.movCC. @ishpaul777 |
@robertKozik Are you sure this is not reproducable on the main. I can repro on production. bug.on.prod.mp4tried a few things to fix it, but couldn't find a satisfactory solution. |
I see, I'll check it once again, It can by my fault. But still, I think this PR can try address issue. Can't we disable any pointer interactions on drag? |
@robertKozik
<NoDropZone
key={route.key}
setIsDraggingOver={setIsDraggingOver}
isDraggingOver={isDraggingOver}
>
<View
pointerEvents={isDraggingOver ? 'none' : 'auto'}
style={[
styles.flexRow,
styles.pAbsolute,
styles.w100,
styles.h100,
StyleUtils.getBackgroundColorWithOpacityStyle(themeColors.shadow, CONST.RIGHT_MODAL_BACKGROUND_OVERLAY_OPACITY),
StyleUtils.displayIfTrue(props.state.index === i),
]}
>
<PressableWithoutFeedback
style={[styles.flex1]}
onPress={() => props.navigation.goBack()}
accessibilityLabel={translate('common.close')}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON}
/>
<View style={styles.rightPanelContainer}>{props.descriptors[route.key].render()}</View>
</View>
</NoDropZone>
<NoDropZone
key={route.key}
setIsDraggingOver={setIsDraggingOver}
isDraggingOver={isDraggingOver}
>
<View
style={[
styles.flexRow,
styles.pAbsolute,
styles.w100,
styles.h100,
StyleUtils.getBackgroundColorWithOpacityStyle(themeColors.shadow, CONST.RIGHT_MODAL_BACKGROUND_OVERLAY_OPACITY),
StyleUtils.displayIfTrue(props.state.index === i),
]}
>
{{isDraggingOver && (<View style={styles.dropZoneTopInvisibleOverlay} />)}}
<PressableWithoutFeedback
style={[styles.flex1]}
onPress={() => props.navigation.goBack()}
accessibilityLabel={translate('common.close')}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON}
/>
<View style={styles.rightPanelContainer}>{props.descriptors[route.key].render()}</View>
</View>
</NoDropZone> Problem applying them:We set the isdraggingOver event like below, here when we dragover the child elments (say the RHN), unwanted dragleave event fires set isDraggingover state back to false, and then again dragover event kicks in set the isdraggingover to true, this results in continuous state changing while dragover, to tackle the same situation here we applied another transparent overlay, which here is not possible because it blocks the user interaction completly. function NoDropZone(props) {
const {setIsDraggingOver, isDraggingOver} = props;
function handleDragEnter(event) {
event.preventDefault();
// eslint-disable-next-line no-param-reassign
event.dataTransfer.dropEffect = 'none';
if (isDraggingOver) {
return;
}
setIsDraggingOver(true);
}
function handleDragOver(event) {
event.preventDefault();
// eslint-disable-next-line no-param-reassign
event.dataTransfer.dropEffect = 'none';
}
function handleDragLeave(event) {
event.preventDefault();
setIsDraggingOver(false);
}
useEffect(() => {
document.addEventListener('dragenter', handleDragEnter);
document.addEventListener('dragover', handleDragOver);
document.addEventListener('dragleave', handleDragLeave);
return () => {
document.removeEventListener('dragenter', handleDragEnter);
document.removeEventListener('dragover', handleDragOver);
document.removeEventListener('dragleave', handleDragLeave);
};
}, []);
// rest of code |
Bump @robertKozik, can you please update me. thanks! |
Thank you for your insights on this. I thought It would be more simple to solve. This said I think we can proceed with this PR without fixing it, as it can be also reproduced on main. I'll post a bug report afterwards about it |
@ishpaul777 Could you clean up your code from the |
@robertKozik thanks for pointing this out, I commited unnecessary changes by mistake, did the clean up |
Bump @robertKozik for final review! thanks |
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - Chromeandroid.-.web.movMobile Web - SafariiOS.-.web.movDesktopDesktop.moviOSIOS.-.native.movAndroidScreen.Recording.2023-07-27.at.15.13.32.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor change: unnesessary comment and we will be ready to go.
Also if you would be able to fill remaining videos/screenshots. I know they are unrelated to drop zone behaviour, just show that RHN is render correctly and there is nothing wrong with it after your changes
@robertKozik |
@robertKozik done! update the videos |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks for your cooperation @ishpaul777
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, though we should definitely file a new bug report for that existing bug, can you handle that in Slack if you haven't already? Thanks!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/dangrous in version: 1.3.47-0 🚀
|
Lovely thank you! |
Possible regression: #23881 |
🚀 Deployed to production by https://github.com/Beamanator in version: 1.3.47-6 🚀
|
Details
Fixed Issues
$ #22305
PROPOSAL: #22305 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
Mac (chrome)-mac-chrome.mp4
Mac (safari)-
safari.mp4
Windows (chrome) -
win-chrome.mp4
Mobile Web - Chrome
mobile-web.mp4
Mobile Web - Safari
safari-ios.mp4
Desktop
(Same as before changes)
mac-desktop.mp4
iOS
ios-app.mp4
Android
android.mp4