Re: Strawman: outin control

Following on from our meeting, where Erik pointed out that we could do this 
with an @appearance attribute on <input/>, it seems to me that 
appearance="minimal" would do the trick.

 <input ref="amount" appearance="minimal"/>

would display the amount as if it were an <output/>, unless the control got 
focus, in which case it would be displayed as an input.

Steven



On Friday 02 February 2024 13:07:51 (+01:00), Steven Pemberton wrote:

 > I have a use case in an app I am writing. Actually, it arises a lot.
 > 
 > The idea is that the standard display is just the output, but if I want 
to change a value, I focus on the value, change it, and then focus away.
 > 
 > Well, you can do this in XForms:
 > 
 > 
 >      <switch>
 >         <case id="out">
 >     <trigger appearance="minimal">
 >        <label><output ref="."/></label>
 >        <toggle ev:event="DOMFocusIn" case="in"/>
 >     </trigger>
 >         </case>
 >         <case id="in">
 >     <trigger appearance="minimal">
 >        <label>
 >    <input ref=".">
 >       <toggle ev:event="DOMFocusOut" case="out"/>
 >    </input>
 >    </label>
 >     </trigger>
 >         </case>
 >      </switch>
 > 
 > This works, and does what I want, but to be honest, is a lot of code for 
a simple use-case.
 > 
 > So this is a strawman proposal for 
 >  <outin ref="."/>
 > 
 > to replace the above. Name is open to discussion.
 > 
 > It would otherwise be a normal control, with label, hint, help, etc.
 > 
 > Steven

Received on Friday, 9 February 2024 22:13:37 UTC