-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not copy empty string to clipboard #85
Comments
There is no explicit checks in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When value of the
text
prop is an empty string (i.e.""
), theresult
parameter insideonCopy
istrue
, but the empty string is not copied to the clipboard. Instead, the clipboard retains whatever was already on it.Demo: https://codepen.io/anon/pen/VyvgOr
state.value
has been initialized to an empty string (i.e.""
) instead of to"some\ntext"
. To reproduce the issue, you can manually pre-load your clipboard with a non-empty string (e.g. "abc") and then click on the "Copy to clipboard with button" button in the demo. Although the demo will show the red "Copied" message (suggesting, to me, that the empty string has been copied to the clipboard), the clipboard will continue to contain the previous string (e.g. "abc") instead of the empty string.I expected the clipboard to contain the empty string (i.e. I expected the clipboard to be empty).
Observed in:
The text was updated successfully, but these errors were encountered: