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

Snippet copy feature should use button instead of link

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 18
    • None
    • tools
    • None

      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.

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

              Created:
              Updated:
              Resolved: