Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-116369

<liferay-ui:asset-tags-selector /> generates duplicate IDs

Details

    Description

      The customer discovered a use-case where

      <liferay-ui:asset-tags-selector id="test"/>
      

      will generate a duplicate ID testassetTagNames in the HTML of the page, causing an accessibility issue.

      Reproduction steps:
      1) Create a dummy MVC portlet with the below in the view.jsp:

      <liferay-ui:asset-tags-selector id="test"/>
      

      2) Compile, deploy (See attached plugin [^com.liferay.docs.mvcportlet-1.0.0.jar] )
      3) Place it on a page and inspect the DOM:

      Expected:
      No IDs belonging to the asset tag selector should be duplicated

      Actual behavior:
      The text field and the tag selector field have both id="testassetTagNames"

      Reproduced on 7.1.x @ 385d3bbfc0d1ec86cd564076c2c7d06e5bfdeb5ca9014ceade204c7ea48eb082
      Reproduced on master @ 7456baa3c43b0b99045a078309a57fa9e38bd3e8cb72be25406a7a8c168c9adf, the console will also print:

      [DOM] Found 2 elements with non-unique id #testassetTagNames: (More info: https://goo.gl/9p2vKq) <input class=​"form-control lfr-tag-selector-input field-input-text" id=​"testassetTagNames" maxlength=​"75" size=​"15" title=​"Add Tags" type=​"text" tabindex=​"null" autocomplete=​"off">​ <input class=​"form-control lfr-tag-selector-input" id=​"testassetTagNames" maxlength=​"75" size=​"15" title=​"Add Tags" type=​"text">​

      On the OOTB Web Content Display portlet:

      Reproduced on 7.1.x : just add a new piece of web content through the portlet and expand the tag selector in the "Metadata" section: there will be 2 elements with duplicate ID.
      Not reproduced on master, there won't be ID duplication.

      This case is similar to LPS-101182, but in that LPS categories are involved instead and multiple issues come from the fact of having duplicate IDs.

      * Please see Zendesk Support tab for further comments and attachments.

      Attachments

        Issue Links

          Activity

            People

              summer.zhang Summer Zhang
              jonathan.mak Jonathan Mak (Inactive)
              Kiyoshi Lee Kiyoshi Lee
              Jonathan Mak Jonathan Mak (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                2 years, 30 weeks, 5 days ago

                Packages

                  Version Package
                  7.1.10 DXP FP19
                  7.1.10.5 SP5
                  7.1.X
                  7.2.10 DXP FP7
                  7.2.X
                  7.3.4 CE GA5
                  7.3.10 DXP GA1
                  Master