Opened 4 years ago

Closed 4 years ago

#16754 closed Bug (duplicate)

forms.extras.widgets.SelectDateWidget.render ignores 'attr' parameter

Reported by: kmike Owned by: nobody
Component: Forms Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

It should be passed to create_select method and used for html generation.

Found this issue while debugging this: https://bitbucket.org/kmike/django-widget-tweaks/issue/2/doesnt-work-for-selectdatewidget

Change History (2)

comment:1 Changed 4 years ago by julien

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

I agree that attrs should be used. However, those attributes are supposed to be applied to the widget as a whole rather than to its sub-select inputs. To me the proper way would be to wrap the sub-select inputs with a single piece of markup (e.g. <DIV>), and then the attrs could be applied to that. Although ideally this needs to be done in a way that doesn't break existing code and styles, so I'm marking as DDN until a proper working solution is proposed.

comment:2 Changed 4 years ago by jacob

  • Resolution set to duplicate
  • Status changed from new to closed

I think the best approach is the one proposed in #5851 - allow target each sub-widget directly. Marking as a duplicate of that one.

Thanks!

Note: See TracTickets for help on using tickets.
Back to Top