Page MenuHomePhabricator

HTML bug: Variants menu has elements with identical IDs
Closed, DuplicatePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:
2 elements

What should have happened instead?:

1 element

Other information (browser name/version, screenshots, etc.):

Looks like the template ID is leaking from the dropdown template to the menu.

Event Timeline

The p-variants portlet is the dropdown that says English in this screenshot:

image.png (380×599 px, 26 KB)

Here's the HTML:

<div id="p-variants" class="vector-dropdown ">
	<input type="checkbox" id="p-variants-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-variants" class="vector-dropdown-checkbox webfonts-changed" aria-label="Change language variant">
	<label id="p-variants-label" for="p-variants-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true"><span class="vector-dropdown-label-text">English</span>
	</label>
	<div class="vector-dropdown-content">
		<div id="p-variants" class="vector-menu mw-portlet mw-portlet-variants">
			<div class="vector-menu-content">
				<ul class="vector-menu-content-list">
					<li id="ca-varlang-0" class="selected ca-variants-en mw-list-item">
						<!-- ... -->
					</li>
				</ul>
			</div>
		</div>	
	</div>
</div>

Based on what the #vector-user-links-dropdown menu in the top right corner does (a dropdown menu without a duplicate ID problem), I think we should change the first id="p-variants" to id="vector-variants-dropdown". And leave the second id="p-variants" as is. If I can figure out where to make the code change, I will submit a patch for this.

Change #1036656 had a related patch set uploaded (by Novem Linguae; author: Novem Linguae):

[mediawiki/skins/Vector@master] fix double id="p-variants"

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

Change #1036656 merged by jenkins-bot:

[mediawiki/skins/Vector@master] fix double id="p-variants"

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