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

Passing props & label does not work for checkbox #102

Open
ptitFicus opened this issue Feb 5, 2024 · 0 comments
Open

Passing props & label does not work for checkbox #102

ptitFicus opened this issue Feb 5, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ptitFicus
Copy link
Member

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).

@ptitFicus ptitFicus added the bug Something isn't working label Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant