phoenixframework / phoenix_html

Building blocks for working with HTML in Phoenix

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Would it be possible to put generic_input function as public function?

nicolasblanco opened this issue · comments

Hello!

I would like to easily generate an input with a type that has no helper (for instance an <input type="month"> or whatever).

My idea:
would it be possible to just change generic_input function

defp generic_input(type, form, field, opts)

to be a public function instead of a private function?

This way I could generate a non-supported input easily in my template.

Tell me if you think it's a good or bad idea 👍🏻 .

Mh... Maybe a style issue would be that generic_input function takes the form as the second argument whereas the input helpers takes it as the first 🤔

We should just add the month input as it is part of the HTML 5 spec. :)

@josevalim I've added month_input/3 in my branch in the fork.

Now, I assume that it takes more than just adding the function and the tests for it.
Do you have any pointers on what I should focus on as well?

Hi @zvonimirr! I will actually go ahead and close this. For new Phoenix apps, we are moving towards building the inputs using HEEx, which give users more control and is better optimized. You can check the v1.7-rc for more info!