You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Writing to the clipboard with multiple mime types does not work, only the last type is written to the clipboard.
Importance
Important. My app's user experience is significantly compromised.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
128.0.2739.67
SDK Version
1.0.2592.51
Framework
Win32
Operating System
Windows 11
OS Version
22631.4037
Repro steps
function getClipboardBlob(text, type) {
return new Blob([text], { type });
}
function getClipboardItems(text, html) {
const typeText = "text/plain";
const blobText = getClipboardBlob(text, typeText);
const typeHtml = "text/html";
const blobHtml = getClipboardBlob(html, typeHtml);
const items = [
new ClipboardItem({ [typeText]: blobText, [typeHtml]: blobHtml }),
];
return items;
}
async function writeClipboardTextAsync(text) {
try {
const html = `<a href="${text}">Link!</a>`;
await navigator.clipboard.write(getClipboardItems(text, html));
} catch (error) {
console.error(error.message);
}
}
Using this code to write multiple mime types to the clipboard does not work as expected. Only one of the types is added to the clipboard (the expected behaviour is for both types to be added to the clipboard with applications that understand html content pasting the anchor element while other apps receive the plain text). Reading the clipboard contents directly after the write call shows only a single type returned from ClipboardItem.getTypes (the 'last' property in the object passed to the ClipboardItem constructor).
Repros in Edge Browser
No, issue does not reproduce in the corresponding Edge version
What happened?
Writing to the clipboard with multiple mime types does not work, only the last type is written to the clipboard.
Importance
Important. My app's user experience is significantly compromised.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
128.0.2739.67
SDK Version
1.0.2592.51
Framework
Win32
Operating System
Windows 11
OS Version
22631.4037
Repro steps
Using this code to write multiple mime types to the clipboard does not work as expected. Only one of the types is added to the clipboard (the expected behaviour is for both types to be added to the clipboard with applications that understand html content pasting the anchor element while other apps receive the plain text). Reading the clipboard contents directly after the write call shows only a single type returned from ClipboardItem.getTypes (the 'last' property in the object passed to the ClipboardItem constructor).
Repros in Edge Browser
No, issue does not reproduce in the corresponding Edge version
Regression
Don't know
Last working version (if regression)
No response
AB#54073971
The text was updated successfully, but these errors were encountered: