Skip to content
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

Make outline consistent for all focusable elements in the APP across platforms. #3959

Closed
parasharrajat opened this issue Jul 9, 2021 · 34 comments · Fixed by #4170
Closed
Assignees
Labels
Engineering External Added to denote the issue can be worked on by a contributor Task Weekly KSv2

Comments

@parasharrajat
Copy link
Member

parasharrajat commented Jul 9, 2021

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Open any convo on E.cash on the web.
  2. Try to use the tab for navigation.
  3. See multiple elements get focus with an outline that is different across the platforms.

Expected Result:

  1. same Color of outline for each platform.

Actual Result:

Describe what actually happened

  1. Web(chrome) shows black solid.
  2. Web Firebox shows dotted line.
  3. Desktop has a yellow border.
  4. ETC...

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Just a UI thing.

Platform:

Where is this issue occurring?

Web ✔️
iOS
Android
Desktop App ✔️
Mobile Web

Version Number: Latest
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Screenshot 2021-07-10 01:11:40
Screenshot 2021-07-10 01:11:18
Screenshot 2021-07-10 01:17:52

Expensify/Expensify Issue URL:

View all open jobs on Upwork

view this job on Upwork

cc: @shawnborton

@parasharrajat parasharrajat added the AutoAssignerTriage Auto assign issues for triage to an available triage team member label Jul 9, 2021
@MelvinBot
Copy link

Triggered auto assignment to @stephanieelliott (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

@MelvinBot MelvinBot removed the AutoAssignerTriage Auto assign issues for triage to an available triage team member label Jul 9, 2021
@stephanieelliott
Copy link
Contributor

Was able to demo this by following the reproduction steps 👍

@MelvinBot
Copy link

Triggered auto assignment to @ctkochan22 (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@ctkochan22 ctkochan22 added Task External Added to denote the issue can be worked on by a contributor labels Jul 16, 2021
@ctkochan22 ctkochan22 removed their assignment Jul 16, 2021
@MelvinBot
Copy link

Triggered auto assignment to @jboniface (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@MelvinBot MelvinBot added Daily KSv2 and removed Weekly KSv2 labels Jul 16, 2021
@parasharrajat
Copy link
Member Author

parasharrajat commented Jul 18, 2021

To fix this easiest way is to override the global Outline style so that it reflects on each platform.
Add Global CSS style to index.html

*::focus{
	outline: 1px solid COLOR;
}

or we can use box-shadow as bootstrap uses for the blurred outline.

If don't want to use the global style which I am aware of, the best option to do is to disable the default outline and only apply to the specific elements with

addOutlineWidth()

I would say its better to handle the web-specific global styles as a global stylesheet. We can call this browser-reset. They are used to reset the browser-applied styles which we don't want.

@MelvinBot MelvinBot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 19, 2021
@MelvinBot
Copy link

Triggered auto assignment to @tgolen (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@jboniface
Copy link

@tgolen please check Rajat's proposal when you get a chance!

@tgolen
Copy link
Contributor

tgolen commented Jul 20, 2021

I'm OK with the CSS route. Is that going to make sure that android and ios are consistent too?

@parasharrajat
Copy link
Member Author

Yeah. I think Android or IOS does not have an outline for focused elements. And for those elements which we want to show outline, are already configured to show correct one using addOutlineWidth. But I will double-check this.

@tgolen
Copy link
Contributor

tgolen commented Jul 20, 2021

Hm, OK. That sounds like things would still not be consistent then across platforms, since ALL web elements would get the outline, but android/ios would have it only for specific elements with addOutlineWidth.

@tgolen
Copy link
Contributor

tgolen commented Jul 20, 2021

So maybe using addOutlineWidth across all platforms would be the most consistent approach then.

@parasharrajat
Copy link
Member Author

parasharrajat commented Jul 20, 2021

No so Global styles would be overwritten by addOutlineWidth. There are many elements on the Web that are not configured to show outline but the browser shows a default outline. So it's better to tackle them via Global style and native devices do not have default outlines so no elements show outline unless added.

Just like from reproducing Steps, Native does not have tab navigation.

since ALL web elements would get the outline

They already have but we are trying to set the correct color and style. We can also disable them but that is not accessible.

@tgolen
Copy link
Contributor

tgolen commented Jul 20, 2021

OK, but with your proposal above, it would ADD a default outline to everything in web. Shouldn't the global style be removing the outline from everything by default, and then addOutlineWidth would add it to the elements necessary? I guess I'm expecting the global style to be:

*::focus{
	outline: 0px;
}

@parasharrajat
Copy link
Member Author

I am not sure if disabling the outline is a good idea. It's better to pull the design team for that. We just closed one of the issues #3041 like that.

Yeah, this style will be used to hide them but if we want to hide.

@tgolen
Copy link
Contributor

tgolen commented Jul 20, 2021

Yeah, this style will be used to hide them but if we want to hide.

Sorry, I'm not quite sure what you mean here. Can you please restate that?

@parasharrajat
Copy link
Member Author

I mean,

*::focus{
	outline: 0px;
}

can be used to hide, but only if we want to hide outlines.

@tgolen
Copy link
Contributor

tgolen commented Jul 20, 2021

Ah right, gotcha. So, I think if the problem is "focus styles aren't consistent across platforms", then on web, hiding all outlines by default would fix that problem. Right?

@shawnborton
Copy link
Contributor

Late to the convo here, but hiding the outline styles might be a bad idea for accessibility right?

@parasharrajat
Copy link
Member Author

Yes, hiding outlines is bad.

@tgolen
Copy link
Contributor

tgolen commented Jul 20, 2021

OK, yes, that probably is. But what I'm trying to say is that while the problem that this issue describes is solved by the proposal, it also opens up a brand new issue where focus styles are still inconsistent between platforms. Because in web, any focused element will have an outline now, whereas android/ios will only get outlines for ones that are configured to have outlines.

@parasharrajat
Copy link
Member Author

We already have outlined on WEB but not on Native devices. And you want to fix this problem thus remove outlines on the web. Keeping selected elements aside.

I am saying we set the color correctly as the outline is important. There are few things the web handles differently.

@tgolen
Copy link
Contributor

tgolen commented Jul 20, 2021

We already have outlined on WEB

OK, I think this is the part I didn't realize. If web already has a default focus for everything, then at least we aren't creating a new problem. In that case, making the colors consistent is at least a step in the right direction.

🟢

@parasharrajat
Copy link
Member Author

@shawnborton What would be the outline color?

@shawnborton
Copy link
Contributor

I suppose we could make the outline color the same color that we use for :focus on inputs, which is our brand blue?

That being said, a lot of products have different outline colors based on the element. Take GitHub for example:

image

image

image

Anyways, I think the simplest thing to do is use our blue color for now and then we can revisit individual components if we want to override the default blue behavior. How does that sound?

@parasharrajat
Copy link
Member Author

Yes. Those individual elements already reflect what is assigned to them.

@jboniface jboniface added Weekly KSv2 and removed Daily KSv2 labels Jul 22, 2021
@jboniface
Copy link

reminder to self to pay bonus for this (if i fail to do this let me know, raj)

@arielgreen arielgreen removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 26, 2021
@MonilBhavsar MonilBhavsar reopened this Jul 29, 2021
@MonilBhavsar
Copy link
Contributor

@jboniface PR is merged, Reopening for payment

@Julesssss
Copy link
Contributor

@parasharrajat it looks like this PR introduced a regression.

On commit f99dea6bf I see this:
Simulator Screen Shot - iPhone 12 - 2021-08-02 at 12 23 42

@parasharrajat
Copy link
Member Author

parasharrajat commented Aug 2, 2021

@Julesssss This is not a regression from this PR. I fixed the outline styles for the whole app which was wrong. If any other input in the app is showing this effect and this is a regression from this PR. but all other inputs are working fine.
I just checked that that Component is using overflow:hidden which will hide every outline which I verified by reverting my changes.

Please let me know if you want me to fix that issue.

@Julesssss
Copy link
Contributor

Ah, I see. Thanks for explaining! Yep that would be great, but I'll discuss further on the raised issue.

@MelvinBot
Copy link

@tgolen, @parasharrajat, @jboniface it looks like no one is assigned to work on this job.
Please double the price or add a comment stating why the job isn't being doubled.

@parasharrajat
Copy link
Member Author

Ding Ding. It's done.

@jboniface
Copy link

paid

@botify
Copy link

botify commented Aug 5, 2021

@tgolen @jboniface Be sure to fill out the Contact List!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Engineering External Added to denote the issue can be worked on by a contributor Task Weekly KSv2
Projects
None yet
Development

Successfully merging a pull request may close this issue.