Project

General

Profile

Defect #43662 ยป Fix cursor position handling after inserting inline attachment markup.patch

Yasu Saku, 2026-01-10 09:54

View differences:

app/assets/javascripts/attachments.js
+ (newLineAfter ? '\n' : '')
+ description.substring(cursorPosition, description.length)
);
})
// move cursor into next line
cursorPosition = $textarea.prop('selectionStart');
$textarea.prop({
'selectionStart': cursorPosition + 1,
'selectionEnd': cursorPosition + 1
});
// Move cursor after the inserted markup
var newCursorPosition = cursorPosition + (newLineBefore ? 1 : 0) + imageMarkup.length;
$textarea.prop({
'selectionStart': newCursorPosition + 1,
'selectionEnd': newCursorPosition + 1
});
});
}
}
    (1-1/1)