Page 1 of 1

KeyboardNavigation failing to focus "off-screen" controls inside a ScrollViewer

Posted: 14 Jan 2022, 18:11
by clysmic
<Grid x:Name="MainGrid" KeyboardNavigation.DirectionalNavigation="Cycle">
    <ScrollViewer CanContentScroll="True" Focusable="False">
        <StackPanel>
            <!-- 10 focusable controls defined here. (Sliders, toggles, etc.). Lets call them C0, C1, C2,... through C9 -->
        </StackPanel>
    </ScrollViewer>
    <Border
        <Button x:Name="OkButton"/>
    </Border>
</Grid>
I have something resembling the above XAML. Focus starts on C0. The goal is that you can navigate C0-C9 with the keyboard. If you press down when you are focused on C9, focus should cycle to the OkButton, and vice versa if you are focused on the OkButton and press up. Lastly, down on OkButton should move focus back up to C0, and likewise up on C0 should wrap to OkButton.

What I've described above is exactly how it works in Blend and WPF. However, in Noesis, I am observing something different. Let's say that the scrollable view is only big enough to display 3 controls (C0 - C2). In Noesis, when I am focused on C2 and press down, it focuses the OkButton. It should be scrolling down a bit and focusing C3! If the window is scrolled enough for any part of C3 to be visible, it would scroll down and focus it, but if it's not visible it is getting skipped! I think this is a bug in how Noesis is choosing what control to target with navigation commands.

Image

Re: KeyboardNavigation failing to focus "off-screen" controls inside a ScrollViewer

Posted: 17 Jan 2022, 10:56
by sfernandez
If the behavior is different from WPF then it is a bug in Noesis, could you please report it in our bugtracker?

Re: KeyboardNavigation failing to focus "off-screen" controls inside a ScrollViewer

Posted: 18 Jan 2022, 16:24
by clysmic
Edit: done. #2242

Re: KeyboardNavigation failing to focus "off-screen" controls inside a ScrollViewer

Posted: 19 Jan 2022, 12:48
by jsantos
Thanks for the report!