summaryrefslogtreecommitdiff
path: root/tests/activeFocus.ur
blob: 82d2c0c99d94b167fbf11df69d32c7a29109b1da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
fun main () : transaction page =
    i <- fresh;
    return <xml><body>
      <ctextbox/>
      <ctextbox id={i}/>
      <active code={giveFocus i; return <xml>Done</xml>}/>
    </body></xml>

fun dynamic () : transaction page =
    x <- source <xml/>;
    return <xml><body>
      <dyn signal={signal x}/>
      <button onclick={fn _ => i <- fresh; set x <xml>
        <ctextbox/>
        <ctextbox id={i}/>
        <active code={giveFocus i; return <xml>Done</xml>}/>
      </xml>}>Click</button>
    </body></xml>