Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checkbox element and html_id #120

Open
bunnylushington opened this issue Mar 19, 2021 · 0 comments
Open

checkbox element and html_id #120

bunnylushington opened this issue Mar 19, 2021 · 0 comments

Comments

@bunnylushington
Copy link

Contrary to expectation, the attribute html_id doesn't set the ID of a checkbox element. I'm not sure if this is a bug per se or a gap in the documentation (or me being thick).

For instance

#checkbox{ html_id=an_html_id, label_position=none }.

produces something like

<input id="wfid_temp71619" type="checkbox" class="wfid_temp71619 checkbox" value="on"/>

I believe this is to facilitate the auto-generation of labels (and specifically the label for attribute).

It's possible to work around this (e.g., to employ custom Bootstrap elements):

TmpID = wf:temp_id(),
#panel{ class="custom-control custom-switch",
        body=
          [ #checkbox{ class="custom-control-input",
                       label_position=none,
                       anchor=TmpID},
            #label{ class="custom-control-label",
                    text="My Label"l,
                    for="wfid_" ++ TmpID }
          ]}.

and this is really fine in practice but was some work to track down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant