views:

18

answers:

1

I'm finding that Silverlight's ScrollViewer will still take focus even when the scrollbars are not visible.

Has anyone else seen this issue? Are there any workarounds that will prevent the ScrollViewer acting as a tabstop when the scrollbars are invisible?

Thanks,

+1  A: 

What about:

<ScrollViewer IsTabStop="False" ...

HTH,
Kent

Kent Boogaart
That's exactly what I've done, but it's hack not a solution.The ScrollViewer, with IsTabStop set to true, should behave such that it only takes focus when there is a scrollbar to focus on.I'm thinking this must be a bug.
elggarc
Not sure I agree. `ScrollViewer` is a control in its own right, regardless of whether the scrollbars (child controls) are visible. If you only want the control to get focus when its scrollbars are visible, you could just bind `Focusable` such that it's `true` only when the extent exceeds the viewport.
Kent Boogaart
The scrollviewer acting as an invisible tabstop when the scrollbars are not required does seem like incorrect behaviour to me. Anyone considering keyboard interaction will find a misterious extra key-press required whilst navigating using the tab key.
elggarc
...but I have not taken into account how a scrollviewer should behave if the scrollbars are invisible, because they have been explicitly set or styled that way, and the content is still bigger than the viewport. In this case a developer could well want focus to go to the scrollviewer.
elggarc