Seeking input on Textarea widget not having an input_type

I’d like to get community feedback on whether it would be desirable to anyone else to add an input_type attribute to the Textarea widget class.

I came across this when trying to write template code to output form fields with custom markup and I was trying to use input_type to check what kind of field I’m looking at as I loop through them, only to find out that textareas don’t have that. Because it’s template code, options for determining what the field type is are pretty limited. I’m working around it by checking the widget’s template_name, but that feels a lot less clean.

I found a seven-year-old ticket for this issue that was closed as invalid with little discussion, and found it puzzling. I think @minusf 's final comment on the matter is pretty sound, but the discussion ended there:

I understand that the “abstraction” is leaking. But Select and RadioSelect both have input_type, even if for a “different purpose”, those can be used in the same way as input_type for “true” Input widgets… It’s not ideal, but it’s already there and only Textarea is left out in the cold. The other alternative could be to add widget_type or such to every Widget subclass but at this point it would just duplicate input_type.

I thought it might be impolite to just open a new issue, and a friend suggested it might be good to open a discussion here and try to get some community consensus, so here I am.

Would anyone else be interested in reconsidering this issue?

2 Likes

I am still around :waving_hand:
Didn’t expect this ticket to come back from the dead :zombie: :sweat_smile:

2 Likes