Make WordPress Core

Opened 7 years ago

Last modified 5 weeks ago

#44103 reopened enhancement

change the type attribute of #menu_order from 'text' to 'number'

Reported by: tmatsuur's profile tmatsuur Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 4.9.5
Component: Editor Keywords: has-patch
Focuses: Cc:

Description

Currently, when focus shifts to the input box of menu_order in the situation that the IME is turned on, an extra operation such as inputting a numerical value after turning off the IME is necessary.
I would like to improve on this.

Now:

<input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo esc_attr( $post->menu_order ); ?>" />

Change:

<input name="menu_order" type="number" id="menu_order" value="<?php echo esc_attr( $post->menu_order ); ?>" />

Also, please add a style to specify the width.

Attachments (1)

44103.diff (1.5 KB) - added by soulseekah 7 years ago.
type="text" to type="number" on menu_order inputs

Download all attachments as: .zip

Change History (15)

@soulseekah
7 years ago

type="text" to type="number" on menu_order inputs

#1 follow-up: @soulseekah
7 years ago

  • Keywords has-patch ux-feedback added

Thank you for bring this to our attention. Patch attached.

#2 in reply to: ↑ 1 @tmatsuur
7 years ago

Replying to soulseekah:

Thank you for bring this to our attention. Patch attached.

Thank you for attached the patch.

This ticket was mentioned in Slack in #design by karmatosed. View the logs.


5 years ago

#4 @melchoyce
5 years ago

Could someone add some before/after screenshots? That'll help folks reviewing to understand the context.

#5 @tmatsuur
5 years ago

https://elearn.jp/img/44103-fig.png

I'm not sure how to attach an image. Is this all right?

On the left is version 4.9.12. After clicking the menu order input box, type 5.

The right side is version 5.3.0. Clicking the menu order input box automatically switches the IME from Japanese mode to English mode.

#6 follow-up: @melchoyce
5 years ago

Thanks @tmatsuur. Just to clarify, is that 5.3.0 with 44103.diff applied?

#7 in reply to: ↑ 6 @tmatsuur
5 years ago

Replying to melchoyce:

Thanks @tmatsuur. Just to clarify, is that 5.3.0 with 44103.diff applied?

Oops, sorry.

Here is the image with the patch applied.

https://elearn.jp/img/44103-fig-2.png

#8 @karmatosed
6 weeks ago

  • Keywords reporter-feedback added

We seem to be missing screenshots so going to request those again and we can then review. I realise some time has passed but just incase let's try.

#9 @tmatsuur
5 weeks ago

@karmatosed Thanks.

This request was made for the Classic Editor, around the time just before the Block Editor was officially released.

Now, about seven years have passed since then, and I believe the Classic Editor is receiving only minimal maintenance.

Considering that many users have migrated to the Block Editor, I think this request can be closed without any further action.

Thank you again for your comment.

#10 @karmatosed
5 weeks ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

HI @tmatsuur thank you and I appreciate the follow up. I am going to go-ahead and close this then.

#11 @sabernhardt
5 weeks ago

  • Component changed from General to Editor
  • Keywords changes-requested added; ux-feedback reporter-feedback removed
  • Milestone set to Future Release
  • Resolution wontfix deleted
  • Status changed from closed to reopened
  • Type changed from feature request to enhancement

This involves both Quick Edit and the Classic Editor.

#62109 added the inputmode attribute for datetime fields, but I think type="number" would be better for the pages' Order field:

  • using tiny-text class with the Quick Edit field because the width is already defined as 6em
  • using small-text class with the meta box field

This ticket was mentioned in PR #8308 on WordPress/wordpress-develop by @sabernhardt.


5 weeks ago
#12

In Quick Edit, this:

  • Switches the Order field to a number input.
  • Adds the tiny-text class to remove (right) side padding, without changing the width of 6em.

In the Classic Editor's meta box, this:

  • Switches the Order field to a number input.
  • Removes size attribute.
  • Adds the small-text class to remove the side padding and to define the width (fixed at 65px on large screens, or auto—up to 4.375em—on narrow screens).

Trac 44103

Before:
https://github.com/user-attachments/assets/f9df99c2-4f0d-442c-a696-2b5272f2f906

With patch:
https://github.com/user-attachments/assets/93595258-d5df-44ba-9e74-f7da01f03dc8

@sabernhardt commented on PR #8308:


5 weeks ago
#13

By default, Pages have the menu_order fields, and any other post type could add page-attributes support:

add_action( 'admin_init', function() {
	add_post_type_support( 'post', 'page-attributes' );
} );

#14 @sabernhardt
5 weeks ago

  • Keywords changes-requested removed
Note: See TracTickets for help on using tickets.