Skip to content

Commit

Permalink
add log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
rnag committed Feb 11, 2024
1 parent 8dd1403 commit e0f49a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/clipboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export async function copyRichToClip(rich) {
'text/html': html,
'text/plain': text,
});
console.log(`Saving ${rich}`);
await navigator.clipboard.write([data]);
} else {
// Fallback using the deprecated `document.execCommand`.
Expand Down
5 changes: 4 additions & 1 deletion src/components/textfield/textfield.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ import { copyRichToClip } from '../../clipboard';
const TextField = props => {
let content;

async function handleClick() {
async function handleClick(e) {
let contentVal = content.value;
let copySuccess;

console.log(e.target.value);
console.log(e.target.value?.length);

try {
if (contentVal) {
await copyRichToClip(converter(contentVal));
Expand Down

0 comments on commit e0f49a5

Please sign in to comment.