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
[HOLD for payment 2023-06-19] [$1000] Checkbox border turns green once another window is opened and revert back #18801
In the presence of admin only as a member observe the checkbox, green border appears for a fraction of second, when clicked.
Open another window and observe the checkbox border turns green permanently till clicked again.
Expected Result:
The checkbox should always have a white border when the admin is the only member present, as the admin cannot be selected when using the "Select all" option.
Actual Result:
The border of checkbox "Select all" turns green once another window is opened and reverted back.
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
Android / native
Android / Chrome
iOS / native
iOS / Safari
MacOS / Chrome / Safari
MacOS / Desktop
Version Number: 1.3.13.0 Reproducible in staging?: y Reproducible in production?: y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation
Please re-state the problem that we are trying to solve in this issue.
Checkbox border turns green once focus is shifted back to window
What is the root cause of that problem?
When we un-select the checkbox, we're simply calling onBlur function here. This function just sets the state to be false, which in turn removes the green border. The element itself is actually still focused and when the window becomes active again (after a blur), the onFocus handler of the Pressable component kicks in since the checkbox never went out of focus.
What changes do you think we should make in order to solve the problem?
We need to take the ref of the Checkbox and call the blur method here. This will not only change the blur state of the Checkbox to be false, but will also remove the focus from the Checkbox.
What alternative solutions did you explore? (Optional)
Why do you think this is a bug? When you move to focus back to the old tab, the browser focuses on the previously active element for A11Y. It is the same as pressing the Tab key to highlight an element.
Why do you think this is a bug? When you move to focus back to the old tab, the browser focuses on the previously active element for A11Y. It is the same as pressing the Tab key to highlight an element.
This is not a bug but a feature.
@parasharrajat If the element was active previously, then IT should have the green border prior to the tab switching as well.
This does not answer my question but repel it. Even does not align with your proposal where you are trying to remove the focus #18801 (comment).
I mean, if you look at the code, you can clearly see that we're removing the focus styles without removing the actual focus. This is something that doesn't feel correct and is actually causing this inconsistency when compared with other components that we have in our App. Regardless of what I'm proposing, what makes it a bug IMO is that if an active element does not have a border before the tab switching, then it should not have a border after tab switching as well.
what makes it a bug IMO is that if an active element does not have a border before the tab switching, then it should not have a border after tab switching as well.
Why? What is the reasoning behind this?
I don't think we should be worrying about this issue at all. This is not worth solving. IMO, it gives an advantage to the user. When the user returns back to the App, they can easily see which element was last active. Also, this is browser-native behavior.
@MariaHCD At this point looks like we have nothing to do. We have this PR #20997 that applied this discussed solution i.e add padding. Except that they didn't change the border color. @shawnborton seems okay with that so looks we all set for now. (The green hardcoded is also removed since it's no longer used and the generic blue one is used instead - the blue color is still hard coded though)
Activity
melvin-bot commentedon May 11, 2023
Triggered auto assignment to @mallenexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon May 11, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)allroundexperts commentedon May 11, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Checkbox border turns green once focus is shifted back to window
What is the root cause of that problem?
When we un-select the checkbox, we're simply calling
onBlurfunction here. This function just sets the state to be false, which in turn removes the green border. The element itself is actually still focused and when the window becomes active again (after a blur), theonFocushandler of thePressablecomponent kicks in since the checkbox never went out of focus.What changes do you think we should make in order to solve the problem?
We need to take the
refof theCheckboxand call theblurmethod here. This will not only change the blur state of theCheckboxto befalse, but will also remove the focus from theCheckbox.What alternative solutions did you explore? (Optional)
None
hungvu193 commentedon May 12, 2023
This is decided is not a bug here: #11283 (comment)
cc @parasharrajat
parasharrajat commentedon May 12, 2023
Yes, not a big deal. We can close this.
allroundexperts commentedon May 12, 2023
@parasharrajat It might not be something of a higher priority, but this IS a bug IMO.
parasharrajat commentedon May 12, 2023
Why do you think this is a bug? When you move to focus back to the old tab, the browser focuses on the previously active element for A11Y. It is the same as pressing the Tab key to highlight an element.
This is not a bug but a feature.
allroundexperts commentedon May 12, 2023
@parasharrajat If the element was active previously, then IT should have the
greenborder prior to the tab switching as well.allroundexperts commentedon May 12, 2023
This is happening with
CheckBoxonly. See what happens forRadio Inputs.Screen.Recording.2023-05-12.at.3.22.18.PM.mov
parasharrajat commentedon May 12, 2023
This does not answer my question but repel it. Even does not align with your proposal where you are trying to remove the focus #18801 (comment).
allroundexperts commentedon May 12, 2023
I mean, if you look at the code, you can clearly see that we're removing the focus styles without removing the actual focus. This is something that doesn't feel correct and is actually causing this inconsistency when compared with other components that we have in our App. Regardless of what I'm proposing, what makes it a bug IMO is that if an active element does not have a border before the tab switching, then it should not have a border after tab switching as well.
parasharrajat commentedon May 14, 2023
Why? What is the reasoning behind this?
I don't think we should be worrying about this issue at all. This is not worth solving. IMO, it gives an advantage to the user. When the user returns back to the App, they can easily see which element was last active. Also, this is browser-native behavior.
101 remaining items
MariaHCD commentedon Jun 21, 2023
Thanks, @grgia!
So I think we'll need to fix the hardcoded color now. Thoughts, @bernhardoj @s77rt?
s77rt commentedon Jun 21, 2023
@MariaHCD At this point looks like we have nothing to do. We have this PR #20997 that applied this discussed solution i.e add padding. Except that they didn't change the border color. @shawnborton seems okay with that so looks we all set for now. (The green hardcoded is also removed since it's no longer used and the generic blue one is used instead - the blue color is still hard coded though)
mallenexpensify commentedon Jun 23, 2023
I see a lot of conversation after the PR hit production, any reason I shouldn't pay everyone now? It's been over 7 days
s77rt commentedon Jun 23, 2023
I think it's ready for payment. No further action is required from our end. cc @MariaHCD can you please confirm the same
mallenexpensify commentedon Jun 23, 2023
eeeeps, the old job closed. I was going to try to get this paid before the weekend.
@usmantariq96, @bernhardoj , @s77rt , can you please accept the job and reply here once you have?
https://www.upwork.com/jobs/~0161807157644d1613
s77rt commentedon Jun 24, 2023
@mallenexpensify Accepted!
usmantariq96 commentedon Jun 24, 2023
@mallenexpensify offer accepted
bernhardoj commentedon Jun 24, 2023
@mallenexpensify accepted
MariaHCD commentedon Jun 26, 2023
Perfect, thanks! Yes, looks like we're good to close this out.
mallenexpensify commentedon Jun 26, 2023
Thanks all, everyone is paid (inc. bonus for timeliness, I added this to our design guideline sheet