Opened 17 years ago

Closed 16 years ago

Last modified 16 years ago

#6873 closed (wontfix)

Make rendering of SelectMultiple consistent across browsers

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

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

Download all attachments as: .zip

Change History (10)

by , 17 years ago

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

comment:1 by , 17 years ago

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)

by , 17 years ago

More test fixes, minimum size of one

comment:2 by Marc Fargas, 17 years ago

Triage Stage: UnreviewedDesign 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.

by , 16 years ago

Updated to r8287, tests still fail with UnicodeDecodeError

by , 16 years ago

All tests ok now

comment:3 by , 16 years ago

Filed #8215 on the UnicodeDecodeError issue.

comment:4 by anonymous, 16 years ago

milestone: post-1.0

comment:5 by , 16 years ago

Resolution: wontfix
Status: newclosed

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

comment:6 by (none), 16 years ago

milestone: post-1.0

Milestone post-1.0 deleted

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