Forum Discussion

BrettConlon's avatar
BrettConlon
Community Member
5 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...

  • Hi,

    I'm having a similar issue to Brett, however I've tried Andrew's suggestion, but it's not working.

    I have my text field on the base layer (and this is the only thing on this layer), and then I created another layer (let's call this Layer 2) with all of the other content. It didn't auto focus on the text field and the entire screen was blank (I had to click onto the text field and type still). I then tried to add a trigger to 'Show Layer 2' when the timeline starts on this slide, so at least the screen had the content, but still no auto focusing and the text doesn't appear on top of Layer 2, so I can't see what I'm typing.

    I've tried to put the content as a background image, however it becomes extremely blurry.

    Even tried to change the focus order, however it doesn't autofocus for me to type without having to click on the text field.

    What am I doing wrong?

    Ben

    • KellyAuner's avatar
      KellyAuner
      Staff

      Hi BenjaminLee-a52!

      If you're willing to share your file, it may help troubleshoot the issue. You can attach it here or share it with our team privately in a support case. We'll delete it from our systems once troubleshooting is complete.

  • I'm hitting the same issue. I've created a new slide with a single layer to show what I'm doing in the attachment. The slide has a rectangle that triggers showing the layer when clicked. The layer only has the text entry field on it, but still needs to be clicked in to so the user can type. 

    What am I missing?