idk fuck this

This commit is contained in:
2026-05-27 19:28:00 +02:00
parent 3e1657ec34
commit 9f6215706d
2 changed files with 9 additions and 1 deletions

View File

@@ -2287,6 +2287,8 @@ class CommentSystem {
const fileInput = e.target;
const wrap = fileInput.closest('.comment-input');
if (!wrap) return;
// Clear the attach-pending flag set in the click handler.
wrap._attachPending = false;
const textarea = wrap.querySelector('textarea');
if (!textarea) return;
const previewArea = wrap.querySelector('.comment-file-preview');
@@ -2471,6 +2473,12 @@ class CommentSystem {
wrap._savedCursorPos = textarea.selectionStart;
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');
if (fileInput) fileInput.click();
return;

View File

@@ -6044,7 +6044,7 @@ class NotificationSystem {
// keyboard so textarea loses focus, but _pendingUploads is still set).
const hasPendingUpload = isAttached && Array.from(
container.querySelectorAll('.comment-input')
).some(wrap => (wrap._pendingUploads || 0) > 0);
).some(wrap => (wrap._pendingUploads || 0) > 0 || wrap._attachPending === true);
if (isAttached && !userTyping && !hasPendingUpload) {
// Kill the stabilization ResizeObserver SYNCHRONOUSLY before anything else.
// If it's still alive from the initial anchor-load, it will fire when the