Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#6873 closed (wontfix)

Make rendering of SelectMultiple consistent across browsers

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

Description

At the moment the SelectMultiple widget renders without a size attribute. This is ok in Firefox as this browser simply increases the number of visible lines to match the actual number of choices till it reaches 21 or so. IE7 simply displays 4 lines regardless of the number of choices. Opera uses one line by default. Needless to say this makes the widget even more unusable than it is anyway. One has to scroll and then ctrl+click.

The attached patch changes the render() function to add a size attribute by default that is equal to the number of choices but smaller than 10. Making the display (and usability) equal on all browsers.

The place where this is the biggest problem for me at the moment is the multiple select widget for user groups in the admin. But I believe this is a general problem with the SelectMultiple widget.

Attachments (4)

SelectMultiple-default-size-00.diff (4.3 KB) - added by jarrow 7 years ago.
First shot at adding a default size to SelectMultiple, includes test changes
SelectMultiple-default-size-01.diff (7.0 KB) - added by jarrow 7 years ago.
More test fixes, minimum size of one
SelectMultiple-default-size-02.diff (7.6 KB) - added by jarrow 7 years ago.
Updated to r8287, tests still fail with UnicodeDecodeError
SelectMultiple-default-size-03.diff (15.0 KB) - added by jarrow 7 years ago.
All tests ok now

Download all attachments as: .zip

Change History (10)

Changed 7 years ago by jarrow

First shot at adding a default size to SelectMultiple, includes test changes

comment:1 Changed 7 years ago by jarrow

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

While running the tests for forms I get the following error on my system. No idea where it comes from :( But it seems to be triggered by the patch on widgets.py

ERROR: Doctest: regressiontests.forms.tests.__test__.widgets_tests
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/django/test/_doctest.py", line 2174, in runTest
    failures, tries = runner.run(
  File "/usr/lib/python2.4/site-packages/django/test/_doctest.py", line 1403, in run
    return self.__run(test, compileflags, out)
  File "/usr/lib/python2.4/site-packages/django/test/_doctest.py", line 1316, in __run
    self.report_failure(out, test, example, got)
  File "/usr/lib/python2.4/site-packages/django/test/_doctest.py", line 1183, in report_failure
    out(self._failure_header(test, example) +
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 249: ordinal not in range(128)

Changed 7 years ago by jarrow

More test fixes, minimum size of one

comment:2 Changed 7 years ago by telenieko

  • Triage Stage changed from Unreviewed to Design decision needed

I'm not sure if it's django's job to overcome browser limitations altought it seems reasonable, please try to bring this into django-developers for discussion.

Changed 7 years ago by jarrow

Updated to r8287, tests still fail with UnicodeDecodeError

Changed 7 years ago by jarrow

All tests ok now

comment:3 Changed 7 years ago by jarrow

Filed #8215 on the UnicodeDecodeError issue.

comment:4 Changed 7 years ago by anonymous

  • milestone set to post-1.0

comment:5 Changed 6 years ago by jarrow

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

Opera is usable in the latest version. And who wants to use SelectMultiple anyway :)

comment:6 Changed 6 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

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