[go: up one dir, main page]

Page MenuHomePhabricator

TagMultiselectWidget in no-JS mode should not have more rows than the number of tags
Closed, ResolvedPublic

Description

This was originally noticed on Special:Block - see T324602#8700556 for details.

In no-JavaScript mode, the TagMultiselectWidget is represented by a MultilineTextInputWidget. This is configured to be 10 rows high:

https://gerrit.wikimedia.org/g/mediawiki/core/+/10b17b51328eca57f3e4ac02309c1ff8161dba36/includes/widget/TagMultiselectWidget.php#52

$textarea = new MultilineTextInputWidget( array_merge( [
	'name' => $this->inputName,
	'value' => implode( "\n", $this->selectedArray ),
	'rows' => 10,
	'classes' => [
		'mw-widgets-tagMultiselectWidget-multilineTextInputWidget'
	],
], $this->input ) );

One row is used for each tag. If the maximum number of allowed tags is less than 10, the excessive rows are not needed, so the widget is unnecessarily tall.

We should set the number of rows to the minimum of (10, max number of tags).

Event Timeline

Change 904572 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/core@master] TagMultiselectWidget: Set rows to max number of tags if below 10

https://gerrit.wikimedia.org/r/904572

Change 904572 merged by jenkins-bot:

[mediawiki/core@master] TagMultiselectWidget: Set rows to max number of tags if below 10

https://gerrit.wikimedia.org/r/904572

@Tchanders So it looks like the Username, IP address, or IP range: field box has been fixed but the Pages and Namespaces still seem to be the same. Also one more very minor cosmetic issue regarding Username, IP address, or IP range: field box. When you disable JS, the pixel heights go from 31.99 to 31.82. Only bringing that up since the rest of the field boxes are 31.99 pixel height too.

T333581_IPMasking_SpecialBlock_NoJS.png (1×3 px, 272 KB)

Thanks for looking at this so quickly @GMikesell-WMF!

The pages/namespaces fields are correct, weirdly. The difference is that you can enter >10 items into those fields, whereas you can only enter one item in the target field. (Context: the JS widget let's you enter multiple items as "tags", but the non-JS widgets distinguish the separate items by their being on different lines. That's why we use a multi-line text widget.)

For the change in pixel height, I'll have a look and check whether anything weird is going on there, thanks for raising.

@Tchanders I see, thanks for the explanation! That makes sense.

As for the pixel height for Username, IP address, or IP range:, I'll wait on your feedback. Thanks again!

When you disable JS, the pixel heights go from 31.99 to 31.82. Only bringing that up since the rest of the field boxes are 31.99 pixel height too.

I'm not seeing anything obviously wrong happening here - it might just be due to the different type of widget.