Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#10744 closed feature (wontfix)

Feature Request - add max-height option to selectmenu API

Reported by: TheWitness Owned by:
Priority: minor Milestone: none
Component: ui.selectmenu Version: 1.11.2
Keywords: Cc:
Blocked by: Blocking:

Description

Currently, the only way to set the max-height of a selectmenu before the select menu scrolls, is to either hack this into the jquery-ui.css file, which although works is awkward and does not provide much flexibility, or to hack the DOM using $('#'+id+'-menu').css('max-height', 'blah') function.

It would be much nicer to have this as an option. I see the width there, but not the height, and you can imagine what that does to a page.

Change History (3)

comment:1 in reply to:  description Changed 7 years ago by Scott González

Resolution: wontfix
Status: newclosed

Replying to TheWitness:

Currently, the only way to set the max-height of a selectmenu before the select menu scrolls, is to either hack this into the jquery-ui.css file

Or do it properly by defining the max-height in your own CSS file.

which although works is awkward and does not provide much flexibility

It provides exactly as much flexibility as setting the max-height on any other element.

or to hack the DOM using $('#'+id+'-menu').css('max-height', 'blah') function.

Presumably this "hack" is exactly what your want the option to do.

It would be much nicer to have this as an option. I see the width there, but not the height, and you can imagine what that does to a page.

Simple CSS styles should not be controlled by JavaScript. Isn't that the "hack" you were referring to?

comment:2 Changed 7 years ago by TheWitness

Wow Scott that was quick! Thanks for getting right on top of both of my issues. My only concern with the option to use my own CSS file is from a api framework perspective, it simply add another step of modifying the css file for developers.

Yes, and the 'hack' as I've referred to it is exactly what the selectmenu options processing would have to do anyway. For me there is the idea that if something like dialog(), for example, provides these styling options, why should not the selecmenu()? If you want to keep it closed, that's fine. I have multiple workarounds, but I thought it was an opportunity, that's all.

Regard,

TheWitness

comment:3 Changed 7 years ago by Scott González

Dialog has the option for two reasons: The content area has an auto-height option, so there's related handling for min and max height of the wrappers (which are different sizes than the content, but directly related). The other reason is that this is really controlling the resizable aspect of the dialog (when resizable is set to true).

Note: See TracTickets for help on using tickets.