I have this code in a template:
<$let temp="$:/temp/edtest" disabledBtn={{{ [<temp>getindex[testname]addprefix[test ]is[tiddler]then[no]else[yes]] }}}>
<label>test number<br>
<$edit-text tiddler=<<temp>> index=testname size=8 placeholder=12.10.3 tag=input/>
</label>
<$button actions="<$macrocall $name=showTestDesc test={{{ [<temp>getindex[testname]] }}}/>" disabled=<<disabledBtn>>>See test</$button>
</$let>
As I edit the code, the button becomes disabled when it is not referencing an existing test. Problem: when the disabled status change, the widget are redrawn and the focus is lost! This is totally unacceptable. How could it be made without losing focus as I type?
A circumventing possibility would be to only evaluate the status only as I exit the edit box, that would make things OK as I am editing. But then the focus would still be lost. So not really good a solution.
An other way would be, when entering the status evaluation, to notice where is the focus, change the status and then have the focus restored to the saved situation. But how could we do that?