Forum Discussion

BrettConlon's avatar
BrettConlon
Community Member
2 months ago

How to get a Text Entry field to auto-focus when a layer loads

G'day,

I have a Text Entry field that I'd like to have auto-focus when the layer it's sitting on is triggered to load so you can immediately start typing into it. At the moment, the field sits on top of a coloured box with a "Continue" button next to it. It's a field that the Learn Admin enters a password into, which then puts the course into "Admin mode" allowing them to jump around the course without the usual "NEXT" button restrictions - helpful for quickly troubleshooting course issues. When the "Admin Access layer loads, the field is not focused and you have to first click in the field before you can start typing.

I read another Storyline Forum thread (HERE) on this same issue and they recommended using the "Focus Order" window to set the order of the objects that get jumped to when the user presses the Tab key, but I don't want them to have to press the tab key at all, I just need it to be automatically focused. Another contributor said that the object has to be at the bottom of the timeline (ie. the lowest object in the layering) and that actually works (the field is auto-focused when the layer appears) but I need my Text Entry field to be on top of a coloured box, so that's not going to work for me.

Is there another/proper way to achieve this?

As a workaround, I'm thinking of sending the Text Entry field to be the bottom object and then creating a series of boxes that surround the field (making it appear like its under the field), but I also have a larger 50% transparent, white box under that that I'll have to do the same thing with - a rather kludgy workaround.

Many thanks, Brett

  • AndrewHanley's avatar
    AndrewHanley
    Community Member

    G'day Brett!

    There's a super easy little hack for this.

    If your text field is the only thing on a layer, it will auto focus. That's it! :)

    So pop your content on one layer, and the text field on another.

    (Don't forget to change the text field LAYER PROPERTIES so that "hide other slide layers" is unticked)

    No worries mate! ;)

  • BrettConlon's avatar
    BrettConlon
    Community Member

    Hi Andrew - stellar idea!

    Last night when I made this post I was getting timeout errors and didn't even think the post uploaded. To my surprise, I found out today I now have 2 of the same post uploaded. The other one is HERE. Could you please drop your response in the other post and I'll then delete this one?

    Ta muchly!

  • BrettConlon's avatar
    BrettConlon
    Community Member

    Strangely, your post is showing as greyed out and I noticed it has "Reported" underneath it. I wonder why? Is that an automated thing because the same content is posted in another thread? Weird...

  • ScottDavid's avatar
    ScottDavid
    Community Member

    Great tip, Andrew! Having the text entry field on its own layer is a clever solution. Thanks for sharing.