[Bug 12531] Change the way that select tag and its height works

http://www.w3.org/Bugs/Public/show_bug.cgi?id=12531

--- Comment #4 from brunoais <brunoaiss@gmail.com> 2011-04-25 12:48:04 UTC ---
(In reply to comment #3)
> The editor, Ian Hickson, will eventually respond to all bugs filed, but he can
> often take a few months because of the number of things he tends to do at once.
Ok, np. I just thought he wasn't paying much attention to this one as he seems
like to be paying attention to the ones that are supposed to be deleted (or
something like that).

>  But some quick feedback from me: your proposal is phrased in terms of the type
> of feature you want, not the reasons you want it.

I didn't think that was the image I gave when I typed the problems I encounter
but I'll answer all the questions you give me as well as I can.

>  You'd be better off emphasizing in what situations the status quo is
> inadequate.  I don't
> understand what the problem is with how things work now, or how your proposal
> differs from the status quo.  What are specific examples of times when you've
> used a <select> and run into trouble with the way things work now, what
> problems did you find, and how did you work around them?

Just one apart to make it clear: I marked this as minor just because there's
work around by making more code in the relevant language to solve the issue
except for one case. (I hope I can explain this and not repeat myself a lot).

Real life drawbacks I encounter:
I tried to make a multiple select with a variable number of options. The
options are supposed to be added and removed by javascript.
In the interface, the user has buttons and ways of selection to add options to
that multiple option box. Now's the tricky part:
The multiple selectbox must be in a size from the equivalent of 3 to the
equivalent of as size of 10.
With what I wanted it's easy. Just make a min-height and max-height with simple
testing (in 5 min the test is done) and make the js to add and remove options.
Clean and easy.
With HTML5:
1º Create the code like the other way.
Add these steps in its way:

2º After each option is added, verify how many options it contains.
2.1º If it contains less than 3 then its size will be 3.
2.2º If it contains more than 10, then its size will be 10.
2.3º else then its size = number of options it contains.

For that it's okay, there's reasonably easy a work around login. It needs more
code and it needs testing but one can make it.
Now a trickier one I just remembered (A college asked me earlier this month and
I wasn't able to answer him properly).


I just remembered a real life case, something I had to do with a friend of mine
in order to help him doing a self proclaimed job. (believe me when I say that
it makes sense in the context)
Case: There's a list nested in a parent div. The parent div has a size of ?% (I
think it was 12%) of another element else. The List must follow these rules (by
this order):
1º Have the size of, at least, one option.
2º DO NOT show any empty spaces (so if there's 1 option it must be size 1, 2
options size 2 or 1, 3 options size 3 or 2 or 1, etc...)
3º DO NOT overflow the div (if there are 5 options but only a max of 3 fit,
show a scroll in the list and the 3 options at a time).
4º Be as big (in height) as possible.

How can I accomplish it? Well... For that I need listeners to check when the
window changes size. When it changes size, I need to know the height of the div
that contains the list box. Now that I know the height of the div that contains
the listbox, I need to convert the px to the number of options (I think it was
divide by 10). Now that I know how many options it means, I need to change the
size of the listbox having in account that it must not overflow the div that
contains it at the same time show as many options as possible and not
forgetting that there must be no blank spaces.

I wish I had CSS for this... If my proposal is accepted I may have CSS for
that.
Just use:
min-height: 10px; /*The size of 1 option*/
max-height: 100%;
Problem solved.


There are websites that allow users to inject any CSS they want to all pages so
that everyone may have the look and feel they want. Also, with that, they can
use visibility and display to show and hide what they want all that works and
everyone is happy with that. How about the select boxes? What if I want to
change the size of the selectboxes to one I want in that website? Do I need to
use injected js code (like greasemonkey) to obtain the look I want? I never had
this problem but I think that there are people that have this problem even if
they can live with it.

With my proposal, I think that all stays backwards compatible and the spec
gives the possibility to add this way of working with styles. This is not a
really restrictive matter but it's useful for some looks and feels.

I hope that makes enough sense now. If you need more pls ask for it.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Monday, 25 April 2011 12:48:12 UTC