Edit-text widget losing focus

I know the edit widget can lose focus if it’s editing the same tiddler that it’s in, but that is not the case here.

I’m trying to make a tool for reading a data dictionary and creating a series of quizzes. The user types in the answer and if it matches receives a checkmark. The outer list just reads the data dictionary and does not change when the edit widget changes. Each edit widget has it’s own, independent tiddler to hold the input text. So I can’t see where a feedback refresh loop would be created.

You can see the work in progress here:

https://temp-demo.tiddlyhost.com/#Plurals%20Quiz

Thanks!

1 Like

It seems you have two variables that are constantly getting set each time a keystroke happens in the response boxes…

	response= {{{[<quizTiddler>get[text]] }}}
	size= {{{[<response>trim[]length[]] }}}

Variables get set, but nothing that effects the outer loop nor that affects the holding tiddlers for the edit widget. I thought if those conditions were met I’d be alright, but maybe not. I guess I could rewrite it so that the user has to push a button to check his/her work (postponing the variable evaluation). Not as cool as the way I hoped it could work.

Thanks!

You can fix the problem by re-arranging things so that the $let widget for gettng the response, size, and regexp occurs after the $edit-text widget, like this:

<div class="plurals-quiz">
<$list filter="[{!!dictionary}indexes[]sort[]limit[3]]"
variable="prompt">
<$let 
  quizTiddler={{{[[$:/temp/plurals-quiz/]addsuffix<prompt>]}}}
  answer={{{ [{!!dictionary}getindex<prompt>] }}}>
''<<prompt>>'': <$edit-text  tag="input" tiddler=<<quizTiddler>> size=10 />
<$let
	response= {{{[<quizTiddler>get[text]] }}}
	size= {{{[<response>trim[]length[]] }}}
	regexp={{{ [<response>is[blank]then[JUNK-DNA-IS-YOUR-FRIEND]else<response>] :map[<currentTiddler>addprefix[\b]addsuffix[\b]]}}}
>
<$list filter="[<answer>regexp<regexp>]"> {{$:/core/images/done-button}}</$list>
<br/>
</$let>
</$let>
</$list>
</div>
1 Like

Thanks Eric!

That’s definitely not intuitive. None of those variables had anything to do with the status of the edit widget. But it works now!

Thanks again!