Focus←{ _←'hrH'⎕WC'HTMLRenderer' h←'<input type=text id="input1">' h,←'<input type="text" id=input2">' hrH.HTML←h _←hrH.ExecuteJavaScript'document.getElementById("input2").focus();' 0 }Which is not working for me.
It does work to use the `autofocus` attribute, but that will only work on page load:
Focus2←{ _←'hrH'⎕WC'HTMLRenderer' h←'<input type=text id="input1">' h,←'<input type="text" id=input2" autofocus="">' hrH.HTML←h 0 }But in a single page app I may be replacing content and then need to dynamically set the focus, so this won't do.
Any ideas? I tried putting it on a Dyalog form first, but to no avail. I'm hoping I'm just missing something obvious and we don't need a new method for the HTMLRenderer...