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 |
robertKozik
left a comment
There was a problem hiding this comment.
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 |
robertKozik
left a comment
There was a problem hiding this comment.
Great, thanks for your cooperation @ishpaul777
dangrous
left a comment
There was a problem hiding this comment.
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 Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.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