bug: Unable to empty the clipboard on Android
See original GitHub issueBug Report
Capacitor Version
npx cap doctor
output:
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 1.4.0
@capacitor/core: 1.4.0
@capacitor/android: 1.4.0
@capacitor/ios: 1.4.0
Installed Dependencies:
@capacitor/cli 1.4.0
@capacitor/core 1.4.0
@capacitor/android 1.4.0
@capacitor/ios 1.4.0
[success] Android looking great! 👌
Found 5 Capacitor plugins for ios:
cordova-plugin-badge (0.8.8)
cordova-plugin-camera (4.1.0)
cordova-plugin-email (1.2.7)
cordova-plugin-mediapicker-dmcsdk (2.4.7)
cordova-plugin-simple-image-resizer (0.2.0)
[success] iOS looking great! 👌
Affected Platform(s)
- Android
- iOS
- Electron
- Web
Current Behavior
Clipboard cannot be emptied using empty string / null. The clipboard stays unchanged.
Expected Behavior
The OS clipboard “string” entry should be “cleared” when calling
Clipboard.write({ string: "" })
Sample Code or Sample Application Repo
Clipboard.write({ string: "ABCD" });
Clipboard.write({ string: ""});
Reproduction Steps
- Use the following code to set something in the clipboard :
Clipboard.write({ string: "ABCD" });
- Paste the clipboard anywhere. Result is ABCD
- Use the following code to empty the clipboard :
Clipboard.write({ string: ""});
- Paste the clipboard anywhere. Result should be empty but got ABCD instead
Other Technical Details
npm --version
output: 6.13.2
node --version
output: v11.0.0
pod --version
output (iOS issues only):
Other Information
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Help! Can not clear Clipboard because "Security Policy"
1 Solution The problem seems to be with copying items while using dual messenger. If you copied the text while using the second...
Read more >Clear the clipboard - Microsoft Support
To clear the entire clipboard, click the Clear All button. To delete an individual clip, hover next to the clip, click the arrow...
Read more >Clear Clipboard on Android - Stack Overflow
6 Answers 6 · Copy Text From any Edit text · Press Home->compose new msg · long press edit text view · Paste...
Read more >Fix for Cannont Empty the Clipboard in Office - Online Tech Tips
If you've been using Remote Desktop, you may get the Cannot Copy to Clipboard error because Remote Desktop uses the clipboard and it...
Read more >3 Ways to Access the Clipboard on Android - wikiHow
1. Open any app that supports typing. This can be a note-taking app, your texting app, Google Docs, or similar. 2. Tap and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sorry, I can’t reproduce.
Clipboard is a heap, so it’s not really possible to delete value, it just add a new one on top of the heap, and read return the last one. It’s possible that samsung devices pick the previous value if the last one is
""
.Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.