-
Notifications
You must be signed in to change notification settings - Fork 3k
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 2024-06-20] [$125] [Search v1] Receipt thumbnail background doesn't change back to correct color after hover #43412
Comments
Triggered auto assignment to @anmurali ( |
Job added to Upwork: https://www.upwork.com/jobs/~014338cee918b85ec5 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eh2077 ( |
Upwork job price has been updated to $125 |
ProposalPlease re-state the problem that we are trying to solve in this issue.Receipt thumbnail background doesn't change back to correct color after hover What is the root cause of that problem?This comes from #42823, Here we are using a useHover hook
which sets onMouseLeave event. Line 9 in 2929a91
and then we also set onMouseLeave event here which overwrites the above event so the hover logic fails to work. App/src/components/SelectionList/BaseListItem.tsx Lines 95 to 96 in 2929a91
What changes do you think we should make in order to solve the problem?Presently there are 2 different places that are handling the mousevents this leads to this bug, to solve this I propose we integrate useMouseContext and useHoverHook in one hook called useMouseEvents. we'll use the hook like below: const {isMouseDownOnInput, bindMouseEvents, isHovered} = useMouseEvents();
// rest of code
..
..
..
<PressableWithFeedback
// eslint-disable-next-line react/jsx-props-no-spreading
{...bindMouseEvents(true, true)}
// rest of code //hooks/useMouseEvents.tsx
import type React from 'react';
import {useState} from 'react';
function useMouseEvents() {
const [isMouseDownOnInput, setIsMouseDownOnInput] = useState(false);
const [isHovered, setIsHovered] = useState(false);
const setMouseDown = () => setIsMouseDownOnInput(true);
const setMouseUp = () => setIsMouseDownOnInput(false);
const bindMouseEvents = (shouldStopPropagationOnMouseDown = false, shouldStopPropagationOnMouseUp = false) => ({
onMouseUp: (e: React.MouseEvent<Element, MouseEvent>) => {
if (shouldStopPropagationOnMouseUp) {
e.stopPropagation();
}
setMouseUp();
},
onMouseEnter: () => setIsHovered(true),
onMouseLeave: (e: React.MouseEvent<Element, MouseEvent>) => {
if (shouldStopPropagationOnMouseDown) {
e.stopPropagation();
}
setIsHovered(false);
setIsMouseDownOnInput(true);
}
});
return {isMouseDownOnInput, setMouseDown, setMouseUp, bindMouseEvents, isHovered}
}
export default useMouseEvents; |
@luacmartins I think this has been fixed in #43424 right? |
Yes, it was. Thanks. Closing! |
hello @luacmartins, the root cause for this issue is still unfixed there might still be unidentified hover issues... |
Do you have an example of an existing issue? |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.82-4 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 2024-06-20. 🎊 For reference, here are some details about the assignees on this 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:
|
Coming from this thread, the hover styles are not being applied when the mouse exists the row item.
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @anmuraliThe text was updated successfully, but these errors were encountered: