Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-63274

Copy to clipboard doesn't work for api tokens

    XMLWordPrintable

    Details

    • Similar Issues:
    • Released As:
      jenkins-2.253

      Description

      http://localhost:8080/user/admin/configure

      the api token doesn't appear on my clipboard

      (don't worry about the token itself it's just a dummy local test instance.)

        Attachments

          Issue Links

            Activity

            Hide
            timja Tim Jacomb added a comment -
            Show
            timja Tim Jacomb added a comment - fyi Wadeck Follonier
            Hide
            wfollonier Wadeck Follonier added a comment -

            Tim Jacomb Thank you for the report. I reproduced it locally, will see what I can do there.

            Show
            wfollonier Wadeck Follonier added a comment - Tim Jacomb Thank you for the report. I reproduced it locally, will see what I can do there.
            Hide
            wfollonier Wadeck Follonier added a comment - - edited

            The copy feature was introduced in 2.173 by https://github.com/jenkinsci/jenkins/pull/3977. It was working at that time.
            Still working in 2.235.
            Not working in 2.245 2.239.

            will look further...

            Found it, it was broken since 2.238 ! at that version the copied value is empty (erasing the clipboard)

            Comparison: https://github.com/jenkinsci/jenkins/compare/jenkins-2.237...jenkins-2.238

            No obvious modifications of JavaScript, seems to be related to an issue with CSS. In 2.237 the textArea generated to copy from, had display:inline-block and an height, compared to the one in 2.238, display:block, height=0px;

            At this point, I think it's a regression after https://github.com/jenkinsci/jenkins/pull/4700 as it changed the html/body display/height.

            Show
            wfollonier Wadeck Follonier added a comment - - edited The copy feature was introduced in 2.173 by https://github.com/jenkinsci/jenkins/pull/3977 . It was working at that time. Still working in 2.235. Not working in 2.245 2.239. will look further... Found it, it was broken since 2.238 ! at that version the copied value is empty (erasing the clipboard) Comparison: https://github.com/jenkinsci/jenkins/compare/jenkins-2.237...jenkins-2.238 No obvious modifications of JavaScript, seems to be related to an issue with CSS. In 2.237 the textArea generated to copy from, had display:inline-block and an height, compared to the one in 2.238, display:block, height=0px; At this point, I think it's a regression after https://github.com/jenkinsci/jenkins/pull/4700 as it changed the html/body display/height.
            Hide
            wfollonier Wadeck Follonier added a comment - - edited

            Félix Queiruga Balado as I don't want to break what you did to solve the regression, I will let you find the "correct" way to solve this issue.

            If I change the display of body from flex to block, the copy is working fine.

            Another attempt was to just put:

            el.style.position= "absolute";
            

            in copyButton.js. But I did not dig further to see if it's breaking something else, at least the screen was not "shaking" when doing so.

            Unfortunately when the copyButton was added, not test coverage was put in place. (I have some doubts that it's possible in HtmlUnit)

            Show
            wfollonier Wadeck Follonier added a comment - - edited Félix Queiruga Balado as I don't want to break what you did to solve the regression, I will let you find the "correct" way to solve this issue. If I change the display of body from flex to block, the copy is working fine. Another attempt was to just put: el.style.position= "absolute" ; in copyButton.js . But I did not dig further to see if it's breaking something else, at least the screen was not "shaking" when doing so. Unfortunately when the copyButton was added, not test coverage was put in place. (I have some doubts that it's possible in HtmlUnit)
            Hide
            fqueiruga Félix Queiruga Balado added a comment - - edited

            Id's suggest setting an absolute position and send it offscreen, for example

            top: -99999px; left: -99999px

            Also, set the tabindex attribute to -1

             

            Show
            fqueiruga Félix Queiruga Balado added a comment - - edited Id's suggest setting an absolute position and send it offscreen, for example top: -99999px; left: -99999px Also, set the tabindex  attribute to -1  

              People

              Assignee:
              wfollonier Wadeck Follonier
              Reporter:
              timja Tim Jacomb
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: