Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
owen777
Binge Watcher

TargetList: jumpToItem bug

Hey,
in one of the views in our app I'm trying to use TargetList, because I need a component with the possibility to scroll its items horizontally (by pressing left/right arrow) with keeping the focused item centered on the screen, so TargetList looks like the only choice. I've already implemented it and found a bug when using jumpToItem attribute. It looks like using this attribute to change selected item changes only itemFocused index, while itemSelected index is unchanged. This causes the problem when I programmatically change the focused item right after TargetList is rendered to, let's say the 10th item and then user presses "right" button on the RC - the component scrolls to the second item, because the itemSelected index didn't change after jumpToItem execution, so its value was "0". Using animateToItem makes the same problem.

Update: Even if I select an item after using jumpToItem, so itemSelected index is correct, still when I push arrow button, it scrolls to the second item. So it looks like there is a third, private index.

Are there any plans to fix this problem or does anyone at least know how to work around it? Thanks in advance.

By the way, why the source code of SceneGraph isn't open source? We could fix such bugs and open pull requests with changes.
0 Kudos
3 REPLIES 3
norcaljohnny
Roku Guru

Re: TargetList: jumpToItem bug

Actually, I think your better option would be to set numColumns='x' , numRows='y' and then focusRow='y'and focusColumn='x' and lastly rowFocusAnimationStyle='fixedFocus'
For instance, 
0 1  2  3 4
0 1 [2] 3 4
0 1  2  3 4
would be numColumns='5' numRows='3' focusRow='1'and focusColumn='2' rowFocusAnimationStyle='fixedFocus'
and the the scroll position would stay put on [2]. //focusRows and focusColumns index begin at 0.
0 Kudos
owen777
Binge Watcher

Re: TargetList: jumpToItem bug

"norcaljohnny" wrote:
Actually, I think your better option would be to set numColumns='x' , numRows='y' and then focusRow='y'and focusColumn='x' and lastly rowFocusAnimationStyle='fixedFocus'

I'm not sure about which SceneGraph component are you talking.
0 Kudos
edfernands
Newbie

Re: TargetList: jumpToItem bug

Hi,

I believe the component in question is the TargetGroup (https://sdkdocs.roku.com/display/sdkdoc/TargetGroup).
 
What happens is when we set the jumpToItem it jumps to the correct item, however when we start navigating on the element it backs into the beginning or to the last user handled position. To check this, please go to the sample TwoRowFixedFocus.zip[/url:2u6lk62t] and then add the line “m.top.findNode("tList1").jumpToItem = 20”...

0 Kudos