Closed ayangweb closed 1 month ago
That's actually the intended behaviour. Copying HTML write two types of content to your clipboard.
For now, you could write your own custom listenToClipboard function https://github.com/CrossCopy/tauri-plugin-clipboard/blob/a45bd763571c1924feb7ef0fcef857fef8ad2927/webview-src/api.ts#L256-L259
If you return when HTML is detected, text event won't be triggered.
I will consider adding options to this function.
That's actually the intended behaviour. Copying HTML write two types of content to your clipboard.
For now, you could write your own custom listenToClipboard function
If you return when HTML is detected, text event won't be triggered.
I will consider adding options to this function.
Okay, thanks, I'll try this code
Just added a breakOnType
option for startListening()
and listenToCliipboard()
. Published version v1.0.0.
If you do this, text events will not be emited.
startListening({html: true})
Just added a
breakOnType
option forstartListening()
andlistenToCliipboard()
. Published version v1.0.0.If you do this, text events will not be emited.
startListening({html: true})
Okay, thanks. I'll try it later.
@ayangweb
Sorry I just removed the breakOnType
feature. It's not robust enough.
A new listener onSomethingUpdate
is added. I recommend using this to listen for what types of content is updated, then decide which type to read yourself.
Discussed in https://github.com/CrossCopy/tauri-plugin-clipboard/issues/31
@ayangweb Sorry I just removed the
breakOnType
feature. It's not robust enough.A new listener
onSomethingUpdate
is added. I recommend using this to listen for what types of content is updated, then decide which type to read yourself.Discussed in #31
Okay, thank you author, hard work!
Hey 👋, the
onTextUpdate
event is triggered at the same time when copying the HTML content, is it possible to trigger only theonHTMLUpdate
event!