ludic.ui: emit click reaches on-click, and a select's < steps back
From the user's play: clicking an item in the pack opened nothing, and the wardrobe's picks did not respond - both are a component whose button says `emit click` (ItemCell, LookCell, ListRow), answered by its user's on-click. An on-* attribute's name is kept as a browser would have it, so on-click is on-press (tpl_event), and the emit looked for "click" and found nothing. An emitted name now goes through the same tpl_event. And a settings cycler's left arrow did the right one's job: any press let go on a select stepped it forward. ct_activate_at steps back when it is let go over the select's .ui-prev; Enter and the rest of the select still step forward. Goldens ui_emit_click (the mouse and a press both reach on-click; with the toolchain before this, neither does) and ui_select_arrows (1 -> 0 on <, then 2 on > >; before this, 1 -> 2 on <). The 33 ui examples pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
a299117858
commit
e476a9d975
12 changed files with 129 additions and 2 deletions
1
examples/library/ui_emit_click_parts/Cell.lss
Normal file
1
examples/library/ui_emit_click_parts/Cell.lss
Normal file
|
|
@ -0,0 +1 @@
|
|||
.cell { width: 100px; height: 40px }
|
||||
3
examples/library/ui_emit_click_parts/Cell.ludic
Normal file
3
examples/library/ui_emit_click_parts/Cell.ludic
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
component Cell {
|
||||
prop caption: string = ""
|
||||
}
|
||||
3
examples/library/ui_emit_click_parts/Cell.xml
Normal file
3
examples/library/ui_emit_click_parts/Cell.xml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<div class="item">
|
||||
<button class="cell" on-click="emit click"><p>{caption}</p></button>
|
||||
</div>
|
||||
1
examples/library/ui_emit_click_parts/Pick.lss
Normal file
1
examples/library/ui_emit_click_parts/Pick.lss
Normal file
|
|
@ -0,0 +1 @@
|
|||
div { width: 400px }
|
||||
4
examples/library/ui_emit_click_parts/Pick.ludic
Normal file
4
examples/library/ui_emit_click_parts/Pick.ludic
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
component Pick {
|
||||
state got: int = -1
|
||||
on pick(i: int) { got = i }
|
||||
}
|
||||
5
examples/library/ui_emit_click_parts/Pick.xml
Normal file
5
examples/library/ui_emit_click_parts/Pick.xml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<div>
|
||||
<p>got {got}</p>
|
||||
<Cell caption="a" on-click="pick(1)"/>
|
||||
<Cell caption="b" on-click="pick(2)"/>
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue