Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

[Editor] flash function when it is copied #4022

@jasonLaster

Description

@jasonLaster

@jenncreighton added an awesome highlightLineRange function a couple months ago for selecting lines.

We should use it to highlight the function when it is copied too. We might also want to add a couple of updates to it too:

  1. update the first and last line so we dont flash the entire line but after the first character of the first line and before the last character of the last line
  2. add a new redux action like flashLighlightLine that knows how to add a highlight and then clear it after a second.

Here is where highlightLineRange is used now. We should add it here too:

--- a/src/components/Editor/EditorMenu.js
+++ b/src/components/Editor/EditorMenu.js
@@ -101,7 +101,10 @@ function getMenuItems(
     label: copyFunctionLabel,
     accesskey: copyFunctionKey,
     disabled: !functionText,
-    click: () => copyToTheClipboard(functionText)
+    click: () => {
+      copyToTheClipboard(functionText);
+      // do something here...
+    }
   };

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions