1

I am using enyojs 2.4 and the moonstone library.

What does "can't spot in frozen mode" mean ?

I have two inputs :

{kind: "moon.InputDecorator", name: "emaildec", spotlight: true, defaultSpotlightLeft : "emaildec", components: [
     {kind: "moon.Input", name: "username",placeholder: "e-mail address", onchange: "nameChanged", value:"",classes: "input-style"} //,spotlight: true
   ]
}, 
{tag: "br"},
{kind: "moon.InputDecorator",  name: "pwddec" , spotlight: true, defaultSpotlightLeft : "pwddec", components: [
     {kind: "moon.Input", name: "userpwd",type:"password", placeholder: "ameba password", onchange: "passwordChanged", value: "",classes: "input-style"} //,spotlight: true
   ]
}

This console error is thrown when I attempt to set focus on the password input :

 enyo.Spotlight.spot(this.$.userpwd);

What I want to happen is:

  • user fills in first input using onscreen keyboard
  • user then navigates to enter button on onscreen keyboard and presses ok/enter on remote control
  • focus is set to second input.
Fabii
  • 3,820
  • 14
  • 51
  • 92
  • 1
    And where do you get "can't spot in frozen mode" from? – Bergi Sep 18 '14 at 16:28
  • A google search for "can't spot in frozen mode" only takes us here. Is that the exact message you are getting? – 000 Sep 18 '14 at 16:39
  • @Bergi it is console output that originates from build/app.js in the moonstone deploy folder. – Fabii Sep 18 '14 at 16:48
  • @JoeFrambach it is console output that originates from build/app.js in the moonstone deploy folder – Fabii Sep 18 '14 at 16:49
  • 1
    Why the downvote ? The fact that google yields no answers is why I'm here asking on stackoverflow. If I could find an answer on google I wouldn't ask here. – Fabii Sep 18 '14 at 16:51
  • I'm not the person that downvoted you, but the reason you get down voted on StackOverflow is for asking questions that don't contain enough information to answer them. You've added some more information now and it MIGHT almost be possible to answer your question... – aychedee Sep 18 '14 at 16:58

3 Answers3

3

The moon.InputDecorator will automatically unfreeze Spotlight upon a blur event (from the moon.Input), whereupon you could call enyo.Spotlight.spot(). moon.Input will automatically blur itself when it detects the Enter key being pressed, but only if the dismissOnEnter flag is set to true on moon.Input. It sounds like you might actually want to call focus on the desired moon.Input (instead of spotting, as that will just display the Spotlight hovered state on the moon.InputDecorator and not actually spot it), something like this (http://jsfiddle.net/aarontam/nxp8x7ku/):

enyo.create({
handlers: {
    onblur: 'blurHandler'
},
components: [{
    kind: "moon.InputDecorator",
    name: "emaildec",
    spotlight: true,
    defaultSpotlightLeft: "emaildec",
    components: [{
            kind: "moon.Input",
            name: "username",
            placeholder: "e-mail address",
            onchange: "nameChanged",
            value: "",
            classes: "input-style",
            dismissOnEnter: true,
        } //,spotlight: true
    ]
}, {
    tag: "br"
}, {
    kind: "moon.InputDecorator",
    name: "pwddec",
    spotlight: true,
    defaultSpotlightLeft: "pwddec",
    components: [{
            kind: "moon.Input",
            name: "userpwd",
            type: "password",
            placeholder: "ameba password",
            onchange: "passwordChanged",
            value: "",
            classes: "input-style"
        } //,spotlight: true
    ]
}],
blurHandler: function (sender, event) {
    if (event.originator === this.$.username) {
        this.$.userpwd.focus();
    }
}
}).renderInto(document.body);
aarontam
  • 441
  • 1
  • 3
  • 12
  • Just to add clarification, frozen mode is turned on specifically for moon.Input controls (via the focus handler of moon.InputDecorator) as we want focus to remain in the input, even if the pointer moves around and hovers another control, until the input is blurred via a 5-way move or pointer click elsewhere. – aarontam Sep 20 '14 at 19:17
  • Good answer, Aaron! )) – Lex Podgorny Oct 20 '14 at 01:47
1

I'm not exactly sure of the "why", but looking at Spotlight source, it looks like when a control gets spotted, frozen mode is turned on. Now, I would guess it should get turned off when you try to spot a new one, but it doesn't do that.

You could try: enyo.Spotlight.unfreeze(); and then set the spot on your second control, but I haven't tested it to see if there are unintended side effects.

Webby Vanderhack
  • 889
  • 7
  • 13
0

As per @dmikeyanderson on the enyo forum:

It means that the spotlight has been frozen on a control, and until unfrozen the spotlight can't move. There doesn't seem anything wrong with your components, do you have more code to share?

As per @aarontam on the enyo forum:

Hi @Fabii23‌, the moon.InputDecorator will automatically unfreeze Spotlight upon a blur event (from the moon.Input), whereupon you could call enyo.Spotlight.spot(). moon.Input will automatically blur itself when it detects the Enter key being pressed, but only if the dismissOnEnter flag is set to true on moon.Input. It sounds like you might actually want to call focus on the desired moon.Input (instead of spotting, as that will just display the Spotlight hovered state on the moon.InputDecorator and not actually spot it), something like this (based off of the fiddle from @dmikeyanderson‌)

Fabii
  • 3,820
  • 14
  • 51
  • 92