Problem spotlight focus enyo 2.7

Hi all,

my app has multi screen, i create a components as a screen, when i next screen i push new component and set style "display:none" to current component, but when i use mouse click in new screen and spotlight focused in spotlightable item in old component. How to fix my problem?

Thank you.

Comments

  • Spotlight relies on the showing property on controls to determine if a spottable component is visible. So, rather than setting the style yourself you should set that using show(), hide(), or set('showing', [true|false]).

    HTH!
  • Hi @theryanjduffy can you help me code to save history and back in enyo 2.7 when next screen page and press back.

    In my app, i have 2 full screen page as HomePanel and CategoryPanel, i using onRequestCategoryPanel event to transit from HomePanel to CategoryPanel, and history to save data for back event, but i must set history 2 times, i can read inEvent.state from back.
    But my app run incorrect, please send me a demo history and back event if you have.

    Thank you so much.

    var Enyo = require('enyo'), kind = require('enyo/kind'); var CarouselArranger = require('layout/CarouselArranger'); var CategoryPanel = require('./CategoryPanel'), HomePanel = require('./HomePanel'), Signals = require('enyo/Signals'); module.exports = kind({ name:"Clip.MainView", classes:"moon enyo-fit main-view full en-unselectable", components:[ { kind:Signals, onBackButton:'backButtonChanged' }, { name: "panels", classes: "enyo-fit full", components:[ { name: "HomePanel", kind: HomePanel } ] } ], handlers:{ onRequestCategoryPanel:'requestCategoryPanel', }, requestCategoryPanel:function(inSender, inEvent){ history.pushState( { next: "CategoryPanel",previous:"HomePanel" },'push' ); history.pushState( { next: "CategoryPanel",previous:"HomePanel" },'push' ); this.$.HomePanel.hide(); this.$.panels.createComponent({ kind:CategoryPanel, name:'CategoryPanel', categoryId: inEvent.id, categoryName:inEvent.name },{owner:this}); this.$.panels.render(); }, create:function(){ this.inherited(arguments); window.addEventListener("popstate", function(inEvent) { Signals.send("onBackButton", inEvent.state); }); }, backButtonChanged:function(inSender, inEvent){ if(typeof this.$[inEvent.previous]!='undefined'){ this.$[inEvent.previous].show(); } if(typeof this.$[inEvent.next]!='undefined'){ this.$[inEvent.next].destroy(); } } });
Sign In or Register to comment.