Skip to content

Passing props & label does not work for checkbox #102

Description

@ptitFicus

Label isn't correctly associated with checkbox, since for is correctly set, but associated input does not have matching id.

<div class="mrf-mt_10" style="position: relative">
  <label class="mrf-flex mrf-ai_center mrf-mb_5" for="enabled"
    ><span>Enabled</span></label
  ><input
    type="checkbox"
    class="mrf-content_switch mrf-content_switch_button_off mrf-cursor_pointer"
  />
</div>

On the above example, input should have an id valued to "enabled".

Another issue is that props property does not seem to have any effect on generated input :

{
    enabled: {
      label: "Enabled",
      type: type.bool,
      defaultValue: key?.enabled ?? false,
      props: {
        "aria-label": "Enabled",
        id: "enabled",
      },
    }
}

with above configuration, "aria-label" and "id" are not passed down to input (see above html).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions