idk fuck this
This commit is contained in:
@@ -2287,6 +2287,8 @@ class CommentSystem {
|
|||||||
const fileInput = e.target;
|
const fileInput = e.target;
|
||||||
const wrap = fileInput.closest('.comment-input');
|
const wrap = fileInput.closest('.comment-input');
|
||||||
if (!wrap) return;
|
if (!wrap) return;
|
||||||
|
// Clear the attach-pending flag set in the click handler.
|
||||||
|
wrap._attachPending = false;
|
||||||
const textarea = wrap.querySelector('textarea');
|
const textarea = wrap.querySelector('textarea');
|
||||||
if (!textarea) return;
|
if (!textarea) return;
|
||||||
const previewArea = wrap.querySelector('.comment-file-preview');
|
const previewArea = wrap.querySelector('.comment-file-preview');
|
||||||
@@ -2471,6 +2473,12 @@ class CommentSystem {
|
|||||||
wrap._savedCursorPos = textarea.selectionStart;
|
wrap._savedCursorPos = textarea.selectionStart;
|
||||||
wrap._savedCursorEnd = textarea.selectionEnd;
|
wrap._savedCursorEnd = textarea.selectionEnd;
|
||||||
}
|
}
|
||||||
|
// Flag that a file picker is open. Checked by the visibilitychange
|
||||||
|
// guard in f0ckm.js so it doesn't call loadComments (and replace the
|
||||||
|
// textarea DOM) while the mobile file picker is open.
|
||||||
|
// Cleared at the start of the change handler, or left to expire
|
||||||
|
// harmlessly if the user cancels the picker.
|
||||||
|
if (wrap) wrap._attachPending = true;
|
||||||
const fileInput = wrap?.querySelector('.comment-file-input');
|
const fileInput = wrap?.querySelector('.comment-file-input');
|
||||||
if (fileInput) fileInput.click();
|
if (fileInput) fileInput.click();
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -6044,7 +6044,7 @@ class NotificationSystem {
|
|||||||
// keyboard so textarea loses focus, but _pendingUploads is still set).
|
// keyboard so textarea loses focus, but _pendingUploads is still set).
|
||||||
const hasPendingUpload = isAttached && Array.from(
|
const hasPendingUpload = isAttached && Array.from(
|
||||||
container.querySelectorAll('.comment-input')
|
container.querySelectorAll('.comment-input')
|
||||||
).some(wrap => (wrap._pendingUploads || 0) > 0);
|
).some(wrap => (wrap._pendingUploads || 0) > 0 || wrap._attachPending === true);
|
||||||
if (isAttached && !userTyping && !hasPendingUpload) {
|
if (isAttached && !userTyping && !hasPendingUpload) {
|
||||||
// Kill the stabilization ResizeObserver SYNCHRONOUSLY before anything else.
|
// Kill the stabilization ResizeObserver SYNCHRONOUSLY before anything else.
|
||||||
// If it's still alive from the initial anchor-load, it will fire when the
|
// If it's still alive from the initial anchor-load, it will fire when the
|
||||||
|
|||||||
Reference in New Issue
Block a user