@wrnrlr/prelude 0.2.19 → 0.2.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/deno.jsonc +1 -1
- package/example/widget.html +3 -1
- package/package.json +1 -1
- package/src/form.js +3 -1
package/deno.jsonc
CHANGED
package/example/widget.html
CHANGED
package/package.json
CHANGED
package/src/form.js
CHANGED
@@ -54,10 +54,12 @@ export function Select(props) {
|
|
54
54
|
})
|
55
55
|
const fallback = props.placeholder ? h('span', props.placeholder) : 'nbsp'
|
56
56
|
return h('.select', [
|
57
|
-
h('button', {onClick:e=>show(s=>!s)},
|
57
|
+
h('button', {onClick:e=>show(s=>!s)},
|
58
|
+
h(Show, {when:()=>props.value, fallback}, ()=>props.value() || nbsp)),
|
58
59
|
h(Show, {when: show}, h('.options', {style:'position:absolute'}, h(List, {each:()=>selected().options},
|
59
60
|
(option) => h('.option', {
|
60
61
|
onClick: (e) => { e.preventDefault(); props.value(option()); show(false) },
|
62
|
+
class: () => props.value()===option() ? 'selected' : '',
|
61
63
|
style: 'cursor: pointer'
|
62
64
|
}, option)
|
63
65
|
)))
|