How to disable autochange panel when press left or right button

Hi all,
i have moon.Panels with many child panel, but when i press left or right button, this auto change to other panel, how to disable auto change when press left or right?

Thank you so much.


  • edited April 2016
    i solved my problem by comment or this.previous in spotlightRight and spotlightLeft event Panels.js file in moonstone library.
  • Rather than altering framework code, you might consider handling the onSpolightLeft/Right events within your app code and returning true to stop propagation. In addition to avoiding potentially breaking framework changes (this one is probably safe but, in general ...), you also maintain the common UX requirements baked into moonstone.
  • oki thanks @theryanjduffy,
    but i have many panel with many element in each panel, so have a lot time to catch spotlightLeft or spotlightRight event in each panel to disable change previos or next panel.
  • I ran into this issue too. I tried handling the onSpotlightLeft/Right events within the individual panels, but returning true stopped the event from bubbling up to the appropriate handler, so spotlight navigation didn't work at all. I couldn't find any flags in the event that would tell me whether an event was moving spotlight focus off the panel to trigger a change, so that was a bit of a dead end.

    For anyone else that runs into this problem, my solution was to declare a handlers block in the component definition like so:
    	name: "viewPanels", 
    	classes: "enyo-fit", 
    	pattern: "none", 
    	kind: "moon.Panels", 
    	arrangerKind: "enyo.CardSlideInArranger", 
    	handlers: {onSpotlightLeft: "overrideSpotlightPanels", onSpotlightRight: "overrideSpotlightPanels"}, 
    	components: [],
    	overrideSpotlightPanels: function(inSender, inEvent) {
    		//Implement an empty event handler here to override panels' spotlight event handlers.
    In my case, I'm not using breadcrumb navigation, so I can override it entirely, but if you are, it is a simple matter to copy the event handler code from panels.js and tweak as required.

    I'm happy to see that there is an option to turn this behavior off in 2.7.
  • Good solution instead of change code in panels.js lib. Many thank @Aressel
Sign In or Register to comment.