mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-01-12 22:51:09 +08:00
committed by
Nicolas Gallagher
parent
5033e12d18
commit
5855e55615
@@ -8,11 +8,16 @@
|
||||
* @flow
|
||||
*/
|
||||
|
||||
let clipboardAvailable;
|
||||
|
||||
export default class Clipboard {
|
||||
static isAvailable() {
|
||||
return (
|
||||
typeof document.queryCommandSupported === 'function' && document.queryCommandSupported('copy')
|
||||
);
|
||||
if (clipboardAvailable === undefined) {
|
||||
clipboardAvailable =
|
||||
typeof document.queryCommandSupported === 'function' &&
|
||||
document.queryCommandSupported('copy');
|
||||
}
|
||||
return clipboardAvailable;
|
||||
}
|
||||
|
||||
static getString(): Promise<string> {
|
||||
|
||||
Reference in New Issue
Block a user