This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-12-30
Channels
- # aleph (25)
- # announcements (20)
- # babashka (29)
- # babashka-sci-dev (12)
- # beginners (27)
- # biff (3)
- # clojure (29)
- # clojure-europe (21)
- # clojure-nl (1)
- # clojure-norway (1)
- # clojurescript (3)
- # clr (5)
- # code-reviews (4)
- # data-science (7)
- # datahike (6)
- # datascript (3)
- # emacs (9)
- # fulcro (5)
- # graalvm (10)
- # malli (15)
- # nbb (7)
- # off-topic (17)
- # pathom (9)
- # polylith (4)
- # practicalli (15)
- # reitit (3)
- # releases (2)
- # rum (1)
- # shadow-cljs (73)
- # squint (34)
- # tools-deps (3)
- # xtdb (11)
While working through the tutorial, on https://biffweb.com/docs/tutorial/communities/ I came upon this code in the app-page
function in com.eelchat.ui
:
[:option {:value "/app"
:selected (when (= uri "/app"))}
"Select a community"]
I thought there might be a missing part to that when
form, but everything is working, so now I'm wondering if maybe it's a trick to remove the selected
attribute when not on a specific community's page. Or maybe I'm over thinking it.Huh, that definitely looks like a mistake on my part. I think it works because the value of :selected
for all the subsequent options is set correctly.* And if none of those options are selected, then this first one is selected by default. I'll update that code snippet.
*or at least, more correctly... even there it should probably be :selected (when (= url uri) "true")
instead of :selected (when (= url uri) url)
, at least for style.
Good to know. My instincts on these things are as often wrong are they are right.