Skip to content

Input type - string or atom? #136

@angelikatyborska

Description

@angelikatyborska

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions