Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Focus is not consistent on all platforms #5616

Open
samhouts opened this issue Mar 19, 2019 · 2 comments
Open

Focus is not consistent on all platforms #5616

samhouts opened this issue Mar 19, 2019 · 2 comments
Labels
e/7 🕖 7 help wanted We welcome community contributions to any issue, but these might be a good place to start! i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often inactive Issue is older than 6 months and needs to be retested m/high impact ⬛ p/Android p/iOS 🍎 partner/cat 😻 t/bug 🐛 up-for-grabs We welcome community contributions to any issue, but these might be a good place to start!

Comments

@samhouts
Copy link
Member

samhouts commented Mar 19, 2019

Description

This is a larger issue that requires some discussion. The basic summary is this:

All Xamarin.Forms controls are VisualElements, which contains a basic set of properties and events that should work on any VisualElement.

However, the Focus method is not functional on many mobile controls (e.g., Button, WebView) because there is no native option to put focus on such native objects.

Problems:

  1. For many reasons, a11y included, customers would like to put the focus on a Button (or other element) programmatically, and they are currently unable to do so on mobile platforms. Can we do this somehow?

  2. If the answer is No, then should we obsolete the Focus method from VisualElement and move it to a Focusable interface that we can then apply only to elements that are able to be focused? What do we do when that is platform specific?

  3. Moreover, the Focus method is supposed to return a bool value that indicates whether the platform was able to successfully focus the element; in the case of Button, this is erroneously returning true.

@PureWeen
Copy link
Contributor

PureWeen commented Mar 19, 2019

FYI to add to the focus fun

https://developer.android.com/about/versions/pie/android-9.0-changes-28

Views with 0 area (either a width or a height is 0) are no longer focusable.

Which is currently causing this
#5159

Which now makes the behavior of picker a bit weird because with API 28 we want focus to open the picker but it won't become focused unless we "fake" focus it some how

@samhouts
Copy link
Member Author

samhouts commented Sep 3, 2019

Also related to #6536

@samhouts samhouts added inactive Issue is older than 6 months and needs to be retested help wanted We welcome community contributions to any issue, but these might be a good place to start! up-for-grabs We welcome community contributions to any issue, but these might be a good place to start! labels Mar 2, 2020
@samhouts samhouts added this to the 5.0.0 milestone Aug 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
e/7 🕖 7 help wanted We welcome community contributions to any issue, but these might be a good place to start! i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often inactive Issue is older than 6 months and needs to be retested m/high impact ⬛ p/Android p/iOS 🍎 partner/cat 😻 t/bug 🐛 up-for-grabs We welcome community contributions to any issue, but these might be a good place to start!
Projects
None yet
Development

No branches or pull requests

2 participants