Forum Discussion
Change Text Entry Variable without control losing focus?
Jillian, you are a life saver. This was also driving me crazy until I came across your post. Thank you so much.
The jQuery didn't work for me for some reason, so I used standard JavaScript. It's below if anyone else needs it.
The '.acc-textinput' is the class name of the text input box in the Storyline module. I'm assuming this is always the same, but if Articulate ever change the name in the future this code won't work.
document.querySelector('.acc-textinput').addEventListener('keyup', () => {
document.querySelector('.acc-textinput').blur();
document.querySelector('.acc-textinput').focus();
});
This is neat for just handling the focus. The only thing I would add to double check is accessibility. Normally, a screen reader announces the text input's label when it gets the focus along with the content. Since the code makes the input text field lose focus and then regain focus with each key, make sure the screen reader doesn't automatically reannounce the field.