WordPress.org

Make WordPress Core

Opened 12 years ago

Closed 8 years ago

#10331 closed enhancement (fixed)

SELECT multiple="multiple" Size Bug

Reported by: GamerZ Owned by:
Milestone: 3.3 Priority: normal
Severity: normal Version: 2.9.2
Component: Administration Keywords: has-patch
Focuses: Cc:

Description

In wp-admin.css line 430

#wpcontent select {
	padding: 2px;
	height: 2em;
	font-size: 11px;
}

We should remove the height, if not if a select element is set to multiple and size is set to 3, it will display as 1 element instead.

Attachments (4)

wp-admin.css.patch (284 bytes) - added by GamerZ 12 years ago.
admin.select.multiple.css (104.4 KB) - added by transom 11 years ago.
Add select[multiple] to admin css
admin.select.multiple.diff (104.4 KB) - added by transom 11 years ago.
Diff to add Select Multiple to Admin css
10331.patch (347 bytes) - added by SergeyBiryukov 10 years ago.

Download all attachments as: .zip

Change History (24)

#1 @Denis-de-Bernardy
12 years ago

  • Component changed from Formatting to UI
  • Severity changed from normal to major

#2 @mrmist
12 years ago

  • Keywords needs-patch added

#3 @GamerZ
12 years ago

  • Keywords has-patch added; needs-patch removed

#4 @azaozz
12 years ago

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

Multiple selects are not used in core and it seems this normalizes the <select> across browsers. If plugins need it they can easily add more specific style.

#5 @christian_gnoth
11 years ago

  • Resolution wontfix deleted
  • Status changed from closed to reopened
  • Version changed from 2.8 to 2.9.2

hello,
please fix it. It took me a lot of time to find the error.

#6 @ocean90
11 years ago

christian_gnoth: Why? Where we use multiple selects?

#7 @nacin
11 years ago

  • Milestone 2.9 deleted
  • Resolution set to invalid
  • Status changed from reopened to closed
  • Version changed from 2.9.2 to 2.8

Multiple selects are not used in core and it seems this normalizes the <select> across browsers. If plugins need it they can easily add more specific style.

#8 @Denis-de-Bernardy
11 years ago

Multiple selects are not used in core and it seems this normalizes the <select> across browsers. If plugins need it they can easily add more specific style.

It took me a lot of time to find the error.

As much as I agree with the reason it got closed, I can easily imagine a coder who isn't super proficient with WP or CSS spending needless amounts of time on this... This might deserve second thoughts.

#9 @christian_gnoth
11 years ago

  • Resolution invalid deleted
  • Severity changed from major to normal
  • Status changed from closed to reopened
  • Version changed from 2.8 to 2.9.2

hi,
apart from the last useless comment, I still ask you to change it.

I am working on a plugin and I am using a select with multiple options. As I did not used the developer tools like firebug I did not saw the css style definition and waste a lot of time.

So I can image, that everyone, who uses select with the size option will waste time on this problem.

I am using WP 2.9.2

#10 @ocean90
11 years ago

  • Resolution set to invalid
  • Status changed from reopened to closed
  • Version changed from 2.9.2 to 2.8
I am working on a plugin

So you can easily overrite the CSS for your plugin.

As I did not used the developer tools like firebug

You should.

Two leading developers have close this ticket. Please leave it closed and don't waste their time. Thanks.

#11 @christian_gnoth
11 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened
  • Version changed from 2.8 to 2.9.2

hi,
thanks for your helpful answers.

Two leading developers could not solve this problem - I find difficult to belief.

I am not opening it - just for fun - please take this request seriously and solve it!!!

#12 @nacin
11 years ago

  • Keywords needs-patch added; has-patch removed
  • Milestone set to Future Release

I am open to a patch that maintains our cross-browser purposes solved by height:2em while allowing for select[multiple]. Maybe even if it's just select[multiple] { height: auto }.

Please don't just go re-open tickets multiple times though. I've decided to go with Denis' view here that if we can do something, we should. It's not that two lead developers don't know how to fix it, it's just that we aren't inclined to remove height:2em unless there is a viable cross-browser solution for making them look consistent when they are not multiple selects.

#13 @transom
11 years ago

  • Type changed from defect (bug) to enhancement

As this just bit me in the butt today, I thought I'd brave providing a patch.
I have added a a css2 level line that does the following:

#wpcontent select[multiple] { height: 10em; }

Obviously we can argue over the height but I think this addresses the concerns voiced above. Diff attached.

@transom
11 years ago

Add select[multiple] to admin css

#14 @transom
11 years ago

  • Keywords has-patch added; needs-patch removed

#15 @Denis-de-Bernardy
11 years ago

  • Milestone changed from Future Release to 3.1

Patch needs to be in diff format. Else +1 to the suggested fix.

If memory serves, an old browser would completely ignore the whole statement, but I'm not 100%. Can anyone confirm? (And potentially, commit?)

@transom
11 years ago

Diff to add Select Multiple to Admin css

#16 @transom
11 years ago

Idiot alert - it was a diff file that I mislabeled. same file added as diff

#17 @azaozz
11 years ago

I don't like the proposed patch for two reasons:

  • It's not compatible with all currently used browsers as Denis said above.
  • It "locks" the height of the <select multiple=.... What if the plugin author wants to set it to something else, i.e. multiple="3" or there are only 2-3 lines in it?

Still think it's better to leave this to the individual <select> elements, i.e. <select multiple="5" style="......

It also may be possible to drop the height=.. from the default stylesheet. It is intended to normalize the look of the select drop-downs across the currently used browsers but many of them have new versions out that may not need it any more.

#18 @nacin
11 years ago

  • Milestone changed from 3.1 to Future Release

#19 @SergeyBiryukov
10 years ago

10331.patch adds height: auto; for select[multiple].

#20 @helen
8 years ago

  • Component changed from UI to Administration
  • Milestone changed from Future Release to 3.3
  • Resolution set to fixed
  • Status changed from reopened to closed

Got fixed in [18619].

Note: See TracTickets for help on using tickets.