fix adding of pasted text into convex and fix double paste problem
Build and Push Docker Container / build-and-push (push) Successful in 1m40s
Build and Push Docker Container / build-and-push (push) Successful in 1m40s
This commit is contained in:
@@ -176,20 +176,30 @@ fileInput.addEventListener('change',e=>{
|
||||
});
|
||||
|
||||
/* ====== Clipboard handling ====== */
|
||||
window.addEventListener('paste',e=>{
|
||||
if(file || (text && text.trim())) return;
|
||||
const items=e.clipboardData?.items||[];
|
||||
const fItem=[...items].find(it=>it.kind==='file');
|
||||
if(fItem){
|
||||
window.addEventListener('paste', e => {
|
||||
if (e.target === pasteEl) return; // 👈 let browser handle it
|
||||
|
||||
if (file || (text && text.trim())) return;
|
||||
|
||||
const items = e.clipboardData?.items || [];
|
||||
const fItem = [...items].find(it => it.kind === 'file');
|
||||
|
||||
if (fItem) {
|
||||
e.preventDefault();
|
||||
const blob=fItem.getAsFile();
|
||||
if(blob) setFileFromBlob(blob);
|
||||
const blob = fItem.getAsFile();
|
||||
if (blob) setFileFromBlob(blob);
|
||||
return;
|
||||
}
|
||||
const pasted=e.clipboardData?.getData('text')||'';
|
||||
if(pasted){ pasteEl.value=pasted; text=pasted; updateUI(); }
|
||||
|
||||
const pasted = e.clipboardData?.getData('text') || '';
|
||||
if (pasted) {
|
||||
pasteEl.value = pasted;
|
||||
text = pasted;
|
||||
updateUI();
|
||||
}
|
||||
});
|
||||
pasteEl.addEventListener('input',e=>{ text = e.target.value; updateUI(); });
|
||||
|
||||
pasteEl.addEventListener('input',e => { text = e.target.value; updateUI(); });
|
||||
|
||||
/* ====== Expiration handling ====== */
|
||||
expiresMode.addEventListener('change',()=>{
|
||||
|
||||
Reference in New Issue
Block a user