bitcrowd / bitstyles_phoenix

A collection of Elixir phoenix helpers for bitstyles
ISC License
12 stars 0 forks source link

Input type - string or atom? #136

Open angelikatyborska opened 1 month ago

angelikatyborska commented 1 month ago

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

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.