Automations and webhooks for the AT Protocol airglow.run

fix(form): show the placeholder input when "Placeholder..." is picked for a boolean field #86

Open opened by tyb.there-hugo.dev

In the record builder, a boolean field's select has a "Placeholder..." option, but picking it never shows the text input for the placeholder. BooleanField in app/islands/RecordFormBuilder.tsx maps __placeholder__ to onValueChange(""), and it only shows the input when isPlaceholder (value !== "" && value !== "true" && value !== "false") is true. An empty value is never a placeholder, so the input stays hidden and the select drops back to "Select..." on the next render. The input only appears when a loaded template already has a placeholder in that field.

How I know: a happy-dom render of RecordFormBuilder with { live: { type: "boolean" } }. I set #field-live to __placeholder__ and dispatched change. After that, input[aria-label="live placeholder"] was still missing.

Where to start: keep a local "placeholder mode" state in BooleanField, set when the option is picked, so the input renders while the value is still empty. Then move focus to that input so the keyboard user lands on it.

Found by the loop while working on #66, rkey 66, branch loop/66, merged onto main as cdc51e52a488.

Sign up or Sign in to add to the discussion.