Hi Colby, I have an issue while pasting the clipboard Item. The clipboardItem is const clipboardItem = new window.ClipboardItem({ "text/plain": blobPlainText, "text/html": blobHTML, }); navigator.clipboard.write([clipboardItem]); This is to support rich text and plain text. However when I paste the content in One Note. There are two Froms which come in One note as source. This only happens in one note application. Ex. (after pasting in one note) blobHtmlText display here From From How do we restrict it to one.
hey to be honest i haven't hit this, but my instinct tells me that it may just be a problem in how OneNote suppports that. have you seen a similar experience copying elsewhere in OneNote?
@@colbyfayock hey yes you are correct with one note issue. No I have tried word and other rich texts and the functionality is working fine. Thanks for replying 🙂.
@@colbyfayock It seems that in a development environment, Clipboard only works on HTTPs or localhost so you will only be able to test it on your cell phone in production.
Learn how to build a full stack Next.js app in my upcoming course: colbyfayock.com/course
Love this tutorial. Direct, instructive, and straight to the point. Good stuff, Colby!
thanks Mike! 😁
So nice! I definitely didn't know about copying images!
thanks James, definitely handy!
Subscribed in 5 sec of scrolling your channel!
Very helpful for a beginner to get to know whats possible in react.
thank you 🙏
Great video. Straight to the point.
thanks! 🙌
Hi Colby, I have an issue while pasting the clipboard Item. The clipboardItem is
const clipboardItem = new window.ClipboardItem({
"text/plain": blobPlainText,
"text/html": blobHTML,
});
navigator.clipboard.write([clipboardItem]);
This is to support rich text and plain text.
However when I paste the content in One Note. There are two Froms which come in One note as source. This only happens in one note application.
Ex. (after pasting in one note)
blobHtmlText display here
From
From
How do we restrict it to one.
hey to be honest i haven't hit this, but my instinct tells me that it may just be a problem in how OneNote suppports that. have you seen a similar experience copying elsewhere in OneNote?
@@colbyfayock hey yes you are correct with one note issue. No I have tried word and other rich texts and the functionality is working fine. Thanks for replying 🙂.
Get fresh tutorials and other free content straight to your inbox! colbyfayock.com/news
so why you prefer using the browser clipboard directly instead of using a package
Less dependencies and less additional JS (although not much in this case)
@@colbyfayock that make sense
the Clipboard did not work on the Smartphone, it returns the error "undefined". On the computer it works normally. Project Next.js v12.1.5
what device, browser, and method were you using?
@@colbyfayock Samsung, Browser is Chrome and Samsung Internet. both on localhost
@@colbyfayock It seems that in a development environment, Clipboard only works on HTTPs or localhost so you will only be able to test it on your cell phone in production.
@@lucasdeandradeoficialah gotcha interesting. Makes sense though!
Your tutorials are so useful and necessary 🫡
thank you!!