File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -8,14 +8,19 @@ export type UseClipboardResult = Readonly<{
8
8
9
9
/**
10
10
* Indicates whether the UI should show a successfully-copied status to the
11
- * user. This is _not_ the same as an `isCopied` property, because the hook
12
- * does not ever look at the clipboard, and only makes a guess at whether the
13
- * text has been copied.
11
+ * user. When flipped to true, this will eventually flip to false, with no
12
+ * action from the user.
14
13
*
15
- * It is possible for this value to be true, yet for the clipboard not to
16
- * have the user's text in it. Trying to make this property accurate enough
17
- * that it could safely be called `isCopied` led to browser compatibility
18
- * issues in Safari
14
+ * ---
15
+ *
16
+ * This is _not_ the same as an `isCopied` property, because the hook never
17
+ * actually checks the clipboard to determine any state, so it is possible for
18
+ * there to be misleading state combos like:
19
+ * - User accidentally copies new text before showCopiedSuccess naturally
20
+ * flips to false
21
+ *
22
+ * Trying to make this property accurate enough that it could safely be called
23
+ * `isCopied` led to browser compatibility issues in Safari.
19
24
*
20
25
* @see {@link https://github.com/coder/coder/pull/11863 }
21
26
*/
You can’t perform that action at this time.
0 commit comments