Skip to content

Unable to copy using buttons in DevTools #5209

Closed as not planned
Closed as not planned

Description

@DanTup

Reported by @kenzieschmoll at #4540 (comment)

Seeing this issue again when trying to call Clipboard.setData from DevTools, which falls back to calling the VS Code workaround

  window.parent?.postMessage(
    {
      'command': 'clipboard-write',
      'data': data,
    }.jsify(),
    '*'.toJS,
  );

which also fails:

copy is not successful NotAllowedError: Failed to execute 'writeText' on 'Clipboard': Document is not focused.
main.dart.js:50566 Copy failed. This may be as a result of a known bug in VS Code. See https://github.com/Dart-Code/Dart-Code/issues/4540 for more information. Now attempting to use a fallback method of copying the that is a workaround for VS Code only.
VM7:49 Uncaught (in promise) DOMException: Failed to execute 'writeText' on 'Clipboard': Document is not focused.
    at <anonymous>:49:24

Activity

  1. added this to the v3.96.0 milestone on Aug 1, 2024
  2. DanTup commented on Aug 1, 2024

    @DanTup
    MemberAuthor

    @kenzieschmoll I don't seem to be able to repro this on Windows or Mac - can you confirm if these are the same steps you're doing?

    I click in the text editor and copy some text so we know this editor has focus. Then I click directly on the Copy button in DevTools. Then I paste back into the editor and the text appears to have been copied correctly.

    Screen.Recording.2024-08-01.at.11.35.04.mov
  3. DanTup commented on Aug 1, 2024

    @DanTup
    MemberAuthor

    I see we do still write a warning to indicate we're using the fallback, but there's no error from using that for me.

    Screenshot 2024-08-01 at 11 40 45

    I'm on latest stable VS Code (on both PC + Mac) and latest Flutter beta (3.24.0-0.2.pre).

  4. kenzieschmoll commented on Aug 1, 2024

    @kenzieschmoll

    In your video, where is the text coming from that is getting pasted? It looks like it comes from the line you are copying in the VS Code editor and not from DevTools. I would have expected the pasted output to be "flutter: test" if the copy was successful from DevTools.

  5. DanTup commented on Aug 1, 2024

    @DanTup
    MemberAuthor

    @kenzieschmoll "flutter: test" is what is pasted, although it has a newline on the end so the remainder of the comment after the word I pasted over gets pushed onto the next line.

  6. DanTup commented on Aug 22, 2024

    @DanTup
    MemberAuthor

    @kenzieschmoll can you still repro this? Do you have precise steps I can try (I presume on macOS?)

  7. added
    awaiting infoRequires more information from the customer to progress
    on Aug 22, 2024
  8. modified the milestones: v3.96.0, v3.98.0 on Aug 27, 2024
  9. github-actions commented on Sep 17, 2024

    @github-actions

    This issue has been marked stale because it is tagged awaiting-info for 20 days with no activity. Remove the stale label or comment to prevent the issue being closed in 10 days.

  10. modified the milestones: v3.98.0, v3.100.0 on Sep 26, 2024
  11. github-actions commented on Oct 17, 2024

    @github-actions

    This issue has been marked stale because it is tagged awaiting-info for 20 days with no activity. Remove the stale label or comment to prevent the issue being closed in 10 days.

  12. removed this from the v3.100.0 milestone on Oct 31, 2024
  13. DanTup commented on Oct 31, 2024

    @DanTup
    MemberAuthor

    @kenzieschmoll can you still repro this and get precise steps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting infoRequires more information from the customer to progressin devtoolsRelates to integration with Dart/Flutter DevToolsis bugstaleWill be closed soon if no response.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions