Forum Discussion
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
12 Replies
- BrettConlonCommunity Member
OK, as a follow-on from this thread, I've just opened an old course, which had the same non-focused text entry field, so I looked up this discussion again to see what the final outcome was, but I didn't do myself any favours with the above response (LOL), so I thought I'd try figure it out again.
Here's what I just did to successfully give the entry field the desired focus:
- Select the slide needing fixing
- Go into Home > Focus Order > Select "Create a custom focus order" at the top
- Drag the entry field to the top.
When I tested the slide, the cursor was automatically blinking in the field - WOHOO! Weirdly, I had tried that in the past (as described above) but it didn't seem to make a difference at the time.
When I changed the setting back to "The default custom focus order", the focus stopped working for that field, so it definitely seems to be that setting that's making it work.
I hope that helps someone else 🤓