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

Anchor tag with hashed urls (#) don't not work when SPA is enabled

    Details

      Description

      Issue
      Anchor tag has hash (e.g. <a href="home#content_a">Anchor Text</a>) does not work. Browser does not jump down to it.

      Steps to reproduce

      1. Start DXP SP1 + DE10
      2. Place Web Content Display portlet to under Hello World portlet
      3. Click on the Web Content Display portlet's "+" > Basic Web Content
      4. Give it Title & Content:
        Title: Content A
        Content:
        <div style="height: 1000px"></div>
        <p id="content_a">Dummy text</p>
        
      5. Publish
      6. Add a Public Page named "Test"
      7. Place Web Content Display portlet on the "Test" page
      8. Click on the Web Content Display portlet's "+" > Basic Web Content
      9. Give it Title & Content:
        Title: Content B
        Content:
        <a href="home#content_a">Anchor Text</a>
      10. Publish
      11. Enter http://localhost:8080/web/guest/home#content_a into your browser's URL firld to access directly
      12. Your browser jumps down to <p id="content_a">Dummy text</p>, and keeps you entered URL
      13. Go to "Test" page
      14. Click on "Anchor Text" (<a href="home#content_a">Anchor Text</a> in Content B)

      Actual result
      Browser does not jump down to <p id="content_a">Dummy text</p> and #content_a is removed from the end of the original URL unexpectedly.

      Expected result
      Browser jumps to <p id="content_a">Dummy text</p> and keeps the original URL.

      Reproduced in
      DXP SP1 + DE10
      ee-7.0.x (e5993a0ac5252525f04fe2c5b94c40e2d1bc7e43)
      master (3926b827ee4743c388c5614bec52c1f1f48d0e11)

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 25 weeks, 2 days ago

                Packages

                Version Package
                7.0.0 DXP FP13
                7.0.0 DXP SP3
                7.0.3 CE GA4
                7.0.X EE
                7.1.X
                Master