Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8276768

Snippet copy feature should use button instead of link

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 18
    • Component/s: tools
    • Labels:
      None

      Description

      The copy-to-clipboard feature introduced in JDK-8275406 uses a somewhat flimsy mechanism as its user interface. It is implemented as a `<a>` element with `href="#"` and an `onclick` handler. While this works within the javadoc generated documentation, the same markup redirects to the top of the page in other HTML contexts. What is more, a link element is not the appropriate element type for this feature as links are meant to redirect to a new page or section.

      A `<button>` element would be a better match as buttons are meant allow the user to trigger actions. In the process of reimplementing the feature using a button we should also get rid of the ::before CSS pseudo-element use.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              hannesw Hannes Wallnoefer
              Reporter:
              hannesw Hannes Wallnoefer
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: