You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Awaiting Checklist] [$250] Desktop - Workspace - Blue frame appears after pressing enter while uploading a new avatar #71872
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
/**
* By default, focus trap on deactivation will return to the element
* that was focused before activation.
*/
setReturnFocus?:
| FocusTargetValueOrFalse
| ((
nodeFocusedBeforeActivation: HTMLElement | SVGElement
) => FocusTargetValueOrFalse);
What changes do you think we should make in order to solve the problem?
In this PR, we also tried to blur the activeElement, but it's just the workaround so we face the same issue again
In FocusTrapForModal, we can remove setReturnFocus, then set returnFocusOnDeactivate to false
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A
What alternative solutions did you explore? (Optional)
We can dynamically pass returnFocusOnDeactivate and set its default value to true (or not set a default value) and pass false in this case. Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
changed the title [-]Desktop - Workspace - Blue frame appears after pressing enter while uploading a new avatar[/-][+][$250] Desktop - Workspace - Blue frame appears after pressing enter while uploading a new avatar[/+]on Oct 6, 2025
changed the title [-][READY FOR PAYMENT][$250] Desktop - Workspace - Blue frame appears after pressing enter while uploading a new avatar[/-][+][Awaiting Checklist] [$250] Desktop - Workspace - Blue frame appears after pressing enter while uploading a new avatar[/+]on Nov 18, 2025
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
The issue is probably caused by this PR as it returns focus to the previous element.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Activity
melvin-bot commentedon Oct 6, 2025
Triggered auto assignment to @garrettmknight (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.daledah commentedon Oct 6, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Blue frame appears after pressing enter while uploading a new avatar
What is the root cause of that problem?
We applies a box-shadow to elements when they are in the focus-visible state here
App/web/index.html
Lines 64 to 67 in b1a83aa
What changes do you think we should make in order to solve the problem?
anchorRef?.current?.blur()to blur the button here when the user presses itLike the way we did here
App/src/components/Search/SearchRouter/SearchButton.tsx
Lines 37 to 38 in b1a83aa
anchorRefto the dependency of theuseCallBackfunctionWhat specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
Or we just need to prevent the button from being focused when clicking on it:
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
nkdengineer commentedon Oct 6, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Blue frame appears after pressing enter while uploading a new avatar
What is the root cause of that problem?
In setReturnFocus, we always return to the element that was focused before activation.
App/src/components/FocusTrap/FocusTrapForModal/index.web.tsx
Lines 19 to 25 in 1c97603
What changes do you think we should make in order to solve the problem?
In this PR, we also tried to blur the activeElement, but it's just the workaround so we face the same issue again
In FocusTrapForModal, we can remove
setReturnFocus, then setreturnFocusOnDeactivateto falseWhat specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
Eskalifer1 commentedon Oct 6, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Workspace - Blue frame appears after pressing enter while uploading a new avatar
What is the root cause of that problem?
We try to return to the last active element in focusTrapForModal:
App/src/components/FocusTrap/FocusTrapForModal/index.web.tsx
Lines 19 to 24 in 1c97603
This is why, after closing the modal window, we focus the element for loading the avatar
What changes do you think we should make in order to solve the problem?
We need to add onBlur during avatar loading, which can be added here:
App/src/components/AvatarWithImagePicker.tsx
Lines 303 to 308 in 82513d3
Or here:
App/src/components/AttachmentPicker/index.tsx
Lines 113 to 121 in 82513d3
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A
What alternative solutions did you explore? (Optional)
We can dynamically pass
returnFocusOnDeactivateand set its default value to true (or not set a default value) and pass false in this case.Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
[-]Desktop - Workspace - Blue frame appears after pressing enter while uploading a new avatar[/-][+][$250] Desktop - Workspace - Blue frame appears after pressing enter while uploading a new avatar[/+]melvin-bot commentedon Oct 6, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021975259774452765689
melvin-bot commentedon Oct 6, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane (
External)38 remaining items
garrettmknight commentedon Nov 18, 2025
Payment Summary
[-][READY FOR PAYMENT][$250] Desktop - Workspace - Blue frame appears after pressing enter while uploading a new avatar[/-][+][Awaiting Checklist] [$250] Desktop - Workspace - Blue frame appears after pressing enter while uploading a new avatar[/+]garrettmknight commentedon Nov 21, 2025
@sobitneupane checklist please
mjasikowski commentedon Nov 24, 2025
@sobitneupane bump
sobitneupane commentedon Nov 24, 2025
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
sobitneupane commentedon Nov 24, 2025
BugZero Checklist:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
The issue is probably caused by this PR as it returns focus to the previous element.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
garrettmknight commentedon Nov 24, 2025
Summary here is correct
quinthar commentedon Dec 8, 2025
Approved $250 to @sobitneupane