-
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
[HOLD FOR PAYMENT 9/26] [Search v2.3] - 3-dot menu is always at fixed position instead of right above the saved search #49206
Comments
Triggered auto assignment to @CortneyOfstad ( |
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
|
Triggered auto assignment to @carlosmiceli ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?
What alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?
const [threeDotsMenuPosition, setThreeDotsMenuPosition] = useState<AnchorPosition>({horizontal: 0, vertical: 0});
const threeDotsMenuContainerRef = useRef({});
if (!threeDotsMenuContainerRef.current?.[key]) {
threeDotsMenuContainerRef.current = {...threeDotsMenuContainerRef.current, [key]: createRef()};
} This ensures that each three-dot button has its own ref stored in threeDotsMenuContainerRef.
rightComponent: (
<View
ref={threeDotsMenuContainerRef?.current?.[key]}
style={{backgroundColor: 'red'}}
>
<ThreeDotsMenu
onIconPress={() => {
threeDotsMenuContainerRef.current[key].current?.measureInWindow((x, y, width, height) => {
setThreeDotsMenuPosition({
horizontal: x + width,
vertical: y + height,
});
});
}}
menuItems={getOverflowMenu(item.name, Number(key), item.query)}
anchorPosition={threeDotsMenuPosition}
anchorAlignment={{
horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.RIGHT,
vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.TOP,
}}
/>
</View>
), What alternative solutions did you explore? (Optional) |
Demoting to NAB. @dominictb can you work on a fix? |
@luacmartins Yes, I can work on it. |
@luacmartins could I work on this? Since I was the first to propose the same solution but just didn't include the whole code and including code isn't necessary for the proposal I guess. |
Just adding alternative approach ProposalPlease re-state the problem that we are trying to solve in this issue.3-dot menu is always at the fixed position instead of right above the selected saved search. What is the root cause of that problem?The anchor position has the fixed values here App/src/pages/Search/SearchTypeMenu.tsx Line 115 in 0c618ac
What changes do you think we should make in order to solve the problem?we need to seperate out the logic of popover position to a new component
function SearchItemActionPopover({menuItems}: {menuItems: PopoverMenuItem[]}) {
const threeDotsMenuContainerRef = useRef<View>(null);
const [threeDotsMenuPosition, setThreeDotsMenuPosition] = useState({horizontal: 0, vertical: 0});
return (
<View ref={threeDotsMenuContainerRef}>
<ThreeDotsMenu
menuItems={menuItems}
onIconPress={() => {
threeDotsMenuContainerRef.current?.measureInWindow((x, y, width) => {
setThreeDotsMenuPosition({
horizontal: x + width,
vertical: y,
});
});
}}
anchorPosition={threeDotsMenuPosition}
anchorAlignment={{
horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.LEFT,
vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.TOP,
}}
/>
</View>
);
}
export default SearchItemActionPopover; use the above as rightComponent in here App/src/pages/Search/SearchTypeMenu.tsx Lines 112 to 121 in 0c618ac
Screen.Recording.2024-09-16.at.1.25.55.PM.mov |
Issue was deployed production 4 days ago, making the payment date 9/26 — adjusting the title! |
@dominictb — I sent you a payment offer here, please let me know once you accept and I can get that paid ASAP. Thanks! |
@CortneyOfstad Sure, done! |
Payment Summary@dominictb — paid $250 via Upwork |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.35-0
Reproducible in staging?: Y
Reproducible in production?: N/A - new feature, doesn't exist in prod
Issue was found when executing this PR: #48566
Email or phone of affected tester (no customers): applausetester+kh010901@applause.expensifail.com
Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
3-dot menu should be right above the selected saved search.
Actual Result:
3-dot menu is always at the fixed position instead of right above the selected saved search.
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6603097_1726280758540.20240914_102238.mp4
View all open jobs on GitHub
Issue Owner
Current Issue Owner: @CortneyOfstadThe text was updated successfully, but these errors were encountered: