Moonstone Scroller and Spotlighted items

When you have spotlight-able items inside of a moonstone scroller, and you spotlight an item that is outside the fixed dimensions of the scroller, should the scroller automatically scroll the spotlighted item into view? I will try to get a jsfiddle up soon to more clearly demonstrate what I'm talking about, but thought I'd ask in case anyone knows the answer at a high level.

Comments

  • I've seen this from the docs, but don't quite understand the implementation:
    moon.Scroller responds to the onSpotlightFocused event by scrolling the event originator into view. This ensures that 5-way (Spotlight) focused controls are always in view.

    Additionally, moon.Scroller will respond to the onRequestScrollIntoView event, which may be fired explicitly/programmatically by controls that should be scrolled into view.
  • Moonstone controls can bubble the onRequestScrollIntoView event when they want to guarantee they are viewable in a scroller; this currently happens in most controls handling the onSpotlightFocused event. For example, take a look at moon.Button: https://github.com/enyojs/moonstone/blob/05965ab61a0a8c620b5564affddfee918b164817/source/Button.js#L60

    I believe the documentation about moon.Scroller directly responding to onSpotlightFocused to scroll the event originator into view is outdated as this was causing issues with the user spotting other controls while the scroller was trying to scroll a control into view. Will make a note to update this, thanks for catching that!
Sign In or Register to comment.