[Bug 12245] @size on <select> drop-downs is not enough to specify the drop-down maxlength on long options lists with scrollbars

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

--- Comment #21 from Jonas Sicking <jonas@sicking.cc> 2011-05-07 02:03:15 UTC ---
(In reply to comment #20)
> (In reply to comment #19)
> > Why do you need the dropdown to stay within the video?
> 
> This is how the Web page layout is defined and a design requirement. It looks
> better that way.
> 
> I'm apparently not the only Web developer that needs to do this - it has
> created many headaches before:
> http://stackoverflow.com/questions/570642/height-of-an-html-select-box-dropdown 
> http://stackoverflow.com/questions/4457232/limiting-the-displayed-height-of-a-select-drop-down
> http://www.webdeveloper.com/forum/showthread.php?t=80761

None of these say *why* they want to limit the size.

> http://forums.asp.net/t/1226413.aspx

This is asking for a new feature to work around bugs in the browser (the fact
that the dropdown goes outside the screen). It's better that we ask browsers to
fix their bugs rather than to add features to work around them.

> http://dojotoolkit.org/reference-guide/dijit/form/Select.html

This doesn't actually select the number of items displayed, but rather limits
the size in pixels. That sounds like something better done using CSS.

> > It seems that we agree that the behavior of keeping the dropdown within the
> > widget/iframe/application it originates from does not match how desktop
> > applications behave.
> 
> That is not what I am asking for. I don't want the browsers to work
> differently. I and an attribute that allows me to define the height of the
> drop-down.

I guess I'm confused. What did you mean by "For example, I have an application
with a menu overlayed on a video and I need the drop-down to stay within the
dimensions of the video"

> > Why do you want web applications to behave differently
> > from desktop apps? People generally aim for the opposite.
> 
> I don't want HTML to work differently to desktop apps. Desktop applications
> allow me to restrict the length of the drop-down.

Sure, but they don't generally limit the size to that of a contained widget,
right?

> > Also, if you need for the dropdown to stay within a given box (such as the box
> > occupied by a <video>), then @size isn't enough since you also need to be able
> > to specify if the dropdown opens upwards or downwards.
> 
> That would be an additional parameter that I cannot currently control and it
> might be nice to add that, too. But it's not what this bug is about.

Well, if what this bug is about doesn't solve your use case then it seems like
it should simply be WONTFIXed. That is why it's better to file bugs on problems
rather than suggested solutions.

> > Also, what do you expect to happen if the browser window is part-way off the
> > screen, such that the box that you expect the dropdown to render in would be
> > partly off screen?
> 
> I don't want the browser to behave differently when rendering the drop-down
> (e.g. Firefox continues to render it when half off screen - that's fine). I
> only want to be able to tell it the maximum length of the drop-down rather than
> being restricted to whichever choice the browser implementers made.

But then it might not stay inside the box that the video is occupying, which
seemed to be what you wanted?


I'm still confused as to why you are wanting to do all this. However if we
think about it in terms of simply wanting greater control of the style in which
the dropdown is displayed, then it seems like CSS is the right solution.
Something like a pseudo-element which represents the dropdown and on which you
could set things like border, width and height.

Would that solve your use cases?

-- 
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 Saturday, 7 May 2011 02:03:18 UTC