Bug 35576 - [tvos] Unable to navigate to buttons that are not adjacent to siblings
Summary: [tvos] Unable to navigate to buttons that are not adjacent to siblings
Status: RESOLVED ANSWERED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.TVOS.dll ()
Version: XI 9.3 (xcode 7.1 previews)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-11-05 09:22 UTC by Vincent Roggero
Modified: 2015-11-10 09:36 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
sample project (61 bytes, text/plain)
2015-11-05 13:09 UTC, Vincent Roggero
Details
sample project (53.30 KB, application/zip)
2015-11-06 01:30 UTC, Brad Umbaugh
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description Vincent Roggero 2015-11-05 09:22:50 UTC
Steps:
- Run the attached sample project
- Attempt to navigate to button C or button F

Result:
- Unable to set focus.

Expect:
- When navigating from A to the right button C should get focus. Right from C should go to B. Up from C should go to F. Right from F should go to B. Down from C should go to D.

Also, should the initial focus be on button F?

Here is the button layout:

       F
A             B
       C
D             E
Comment 1 Vincent Roggero 2015-11-05 09:28:56 UTC
=== Xamarin Studio ===

Version 5.10 (build 988)
Installation UUID: 5df374dd-127a-4b3e-bfa6-0a872d52b886
Runtime:
	Mono 4.0.4 ((detached/d481017)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400040004

=== Xamarin.Profiler ===

Not Installed

=== Apple Developer Tools ===

Xcode 7.1 (9079)
Build 7B91b

=== Xamarin.Mac ===

Version: 2.0.2.111 (Starter Edition)

=== Xamarin.iOS ===

Version: 9.3.1.63 (Business Edition)
Hash: efb0d4d
Branch: master
Build date: 2015-10-27 01:36:02-0400

=== Xamarin.Android ===

Version: 5.1.8.0 (Business Edition)
Android SDK: /Users/vincentr/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.4   (API level 19)
		5.0   (API level 21)

SDK Tools Version: 24.1.2
SDK Platform Tools Version: 22.0.0
SDK Build Tools Version: 22.0.1

Java SDK: /usr
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

=== Xamarin Android Player ===

Not Installed

=== Build Information ===

Release ID: 510000988
Git revision: e2bb36197f892ea0fd385585a02cf68cf4f03b5f
Build date: 2015-10-26 12:23:51-04
Xamarin addins: b333d5f54ab244893787ad30eee07e43112fe175
Build lane: monodevelop-lion-xcode7.1

=== Operating System ===

Mac OS X 10.10.5
Darwin Vincents-iMac.local 14.5.0 Darwin Kernel Version 14.5.0
    Wed Jul 29 02:26:53 PDT 2015
    root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64
Comment 2 Sebastien Pouliot 2015-11-05 10:50:27 UTC
There's no attachment to the bug report.
Comment 3 Vincent Roggero 2015-11-05 13:09:15 UTC
Created attachment 13689 [details]
sample project
Comment 4 Vincent Roggero 2015-11-05 15:36:02 UTC
Attachment is too large. Posted on dropbox;
https://www.dropbox.com/s/scgrn186mng5h95/navigation.zip?dl=0
Comment 5 Brad Umbaugh 2015-11-06 01:30:19 UTC
Created attachment 13698 [details]
sample project
Comment 6 Brad Umbaugh 2015-11-06 01:30:45 UTC
Cleaned bin and obj from Vincent's sample project, uploaded directly
Comment 7 Vincent Roggero 2015-11-06 16:09:53 UTC
Attachment added
Comment 8 Sebastien Pouliot 2015-11-10 09:36:01 UTC
> When navigating from A to the right button C should get focus.

It seems Apple implementation prefers the more direct `B` button. There's no algorithm that will cover every case. Apple provides API to give you control over how focusing is done inside your views.

> Also, should the initial focus be on button F?

If you do not override the default behaviour (e.g. PreferredFocusedView) then you get the default behavior, which seems undocumented (did not find it). I suspect it might default to what's closest to the upper-left corner (as it where most people start reading a screen).

Note: this is not a bug in XI, please contact support (see yellow banner on top on the page) if you have support questions.