phoenix_html icon indicating copy to clipboard operation
phoenix_html copied to clipboard

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

Open nicolasblanco opened this issue 3 years ago • 2 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

https://github.com/phoenixframework/phoenix_html/blob/4dc4e45b0e06c6fe26f2e91136fe581171e65e98/lib/phoenix_html/form.ex#L822

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 👍🏻 .

nicolasblanco avatar Jul 08 '22 22:07 nicolasblanco

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 🤔

nicolasblanco avatar Jul 08 '22 22:07 nicolasblanco

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

josevalim avatar Jul 09 '22 07:07 josevalim

@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?

zvonimirr avatar Nov 18 '22 22:11 zvonimirr

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!

josevalim avatar Nov 18 '22 22:11 josevalim