WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 4 years ago

#22965 closed enhancement (fixed)

Change Recent Comments Number Input to type="number"

Reported by: mordauk Owned by: helen
Milestone: 4.4 Priority: normal
Severity: normal Version: 3.5
Component: Comments Keywords: has-patch
Focuses: ui, administration Cc:

Description

In order to be consistent with the rest of the dashboard, the "Number of comments to show:" input field in the Recent Comments widget should be changed to type="number" in order to add the up/down arrows.

Attachments (5)

recent_comments_number_field.patch (1.6 KB) - added by mordauk 6 years ago.
Patch for both dashboard recent comments and main widget
dashboard_comments_number.patch (807 bytes) - added by mordauk 6 years ago.
Updates type to "number" and adds step and min attributes. Changes class to small-text
recent_comments_number.patch (924 bytes) - added by mordauk 6 years ago.
Changes type to number and adds min / step attributes.
22965.diff (2.1 KB) - added by helen 6 years ago.
22965.1.diff (2.4 KB) - added by obenland 6 years ago.
Refresh of Helen's patch. Additionally aligns the number selector vertically.

Download all attachments as: .zip

Change History (18)

@mordauk
6 years ago

Patch for both dashboard recent comments and main widget

#1 @SergeyBiryukov
6 years ago

  • Component changed from General to Administration
  • Milestone changed from Awaiting Review to 3.6

#2 @nacin
6 years ago

  • Cc dev-reviewed added
  • Owner set to helen
  • Status changed from new to assigned

#3 @nacin
6 years ago

  • Cc dev-reviewed removed
  • Keywords dev-reviewed added

#4 @helen
6 years ago

Also to be consistent, these should probably have min and step attributes specified - 1 for both, seems like. 0 on the Dashboard tells you there are no comments yet, and 0 in the widget just gets you the default of 5.

@mordauk
6 years ago

Updates type to "number" and adds step and min attributes. Changes class to small-text

@mordauk
6 years ago

Changes type to number and adds min / step attributes.

@helen
6 years ago

#5 @helen
6 years ago

.small-text on the widgets one makes the input just wide enough to push to a second line, at least on OSX in English. Not the end of the world, but wondering if maybe we should create a .tiny-text class? Would be something like 22965.diff.

#6 @mordauk
6 years ago

I'm all for a new .tiny-text class. The small-text class has always seemed just a little too large for input fields that will never (in all sane applications) go over two digits.

#7 @lessbloat
6 years ago

2 quick comments on 22965.diff​:

1) Having the input push to a new line doesn't seem worth fixing to me, as the title field just above wraps to a new line as well. It looks almost more uniform to me on a new line. Also, even with a new .tiny-text class, won't it still likely wrap for some translations?

2) The padding for the number selector looks off (not sure we can do anything about that):

http://f.cl.ly/items/3t33341m1V060b2P2x0r/number-type-padding.jpg

#8 @helen
6 years ago

I'm not nearly as concerned about the pushing to a new line so much as just providing more generic classes for general use. Not pushing to a new line in this instance would be good to keep it looking the same way it does now, but more of a bonus than a necessity.

#9 @helen
6 years ago

  • Keywords ui-focus added; dev-reviewed removed

@obenland
6 years ago

Refresh of Helen's patch. Additionally aligns the number selector vertically.

#10 @ryan
6 years ago

  • Milestone changed from 3.6 to Future Release

#11 @jeremyfelt
5 years ago

  • Component changed from Administration to Comments
  • Focuses admin added

#12 @wonderboymusic
4 years ago

  • Milestone changed from Future Release to 4.4

#13 @wonderboymusic
4 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 34514:

Widgets: use input[type="number"] for the number prop in the Recent Posts and Recent Comments widget forms.

Props helen, obenland, mordauk.
Fixes #22965.

Note: See TracTickets for help on using tickets.