Uploaded image for project: 'PUBLIC - Liferay Alloy UI'
  1. PUBLIC - Liferay Alloy UI
  2. AUI-3192

Duplicate IDs generated by aui-form-field-deprecated

    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

              Assignee:
              jonathan.mak Jonathan Mak (Inactive)
              Reporter:
              jonathan.mak Jonathan Mak (Inactive)
              Participants of an Issue:
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 3 weeks, 3 days ago

                  Packages

                  Version Package
                  master-deprecated
                  3.1.x
                  3.1.0-deprecated.77