copypasta icon indicating copy to clipboard operation
copypasta copied to clipboard

if target_os = "emscripten" ClipboardContext is not defined and not set to NopClipboardContext;

Open axkibe opened this issue 4 months ago • 1 comments

I would be fine for it getting set to Nop, getting the clipboard works very differently in wasm/emscripten and very much out of this scope having to cross the JS/FFI boundary without web-sys available and getting navigator.clipboard.

But, it doesnt get defined at all and that makes the compiler unhappy.

#[cfg(not(any( unix, windows, target_os = "macos", target_os = "android", target_os = "ios", target_os = "emscripten" )))] pub type ClipboardContext = nop_clipboard::NopClipboardContext;

I think the condition is mixed up here.

Add this before please (under the TODOs for android and ios) #[cfg(target_os = "emscripten")] pub type ClipboardContext = nop_clipboard::NopClipboardContext;

axkibe avatar Jul 28 '25 19:07 axkibe

Makes sense, happy to accept a patch.

chrisduerr avatar Jul 28 '25 20:07 chrisduerr