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

Input type - string or atom? #136

Open
angelikatyborska opened this issue Aug 6, 2024 · 0 comments
Open

Input type - string or atom? #136

angelikatyborska opened this issue Aug 6, 2024 · 0 comments

Comments

@angelikatyborska
Copy link
Contributor

I think the library is pretty unclear about the type of the type attribute of inputs:

    1. should it be atoms?
    1. should it be strings?
    1. should both be supported?

I thought it's option 3 so I wrote this in ui_raw_input's documentation:

  • type - string or atom, defaults to :text

But all the showcase examples use atoms, and there is a check that assumes an atom:

<%= if @type == :checkbox do %>

If you try to use <.ui_input type="checkbox">, you get the elements in the wrong order for a checkbox: label first, input second.

Should we update the documentation and maybe add some runtime check to ensure that types are atoms? In our new client project, we used strings which lead to a problem with the checkboxes.

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