Skip to content

Commit f26543c

Browse files
authored
Merge pull request #1756 from mercihabam/fix-textarea-cursor
fix(frontend): ensure that `replace_cursor_position` function is properly called in pageHandler, fixing missing new lines at the beginning of the textarea in reply and forward mode
2 parents 247993a + d4abf85 commit f26543c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/smtp/js_modules/route_handlers.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// TODO: This function is too large for a route handler, decouple it into multiple functions with action scope focused.
2-
function applySmtpComposePageHandlers() {
2+
function applySmtpComposePageHandlers(routeParams) {
33
init_resumable_upload()
44

55
setupActionSchedule(function () {
@@ -200,10 +200,10 @@ function applySmtpComposePageHandlers() {
200200
toggle_recip_flds();
201201
}
202202
// Handle focus management for different compose scenarios
203-
if (window.location.href.search('&reply=1') !== -1 || window.location.href.search('&reply_all=1') !== -1) {
203+
if (routeParams.reply == 1 || routeParams.reply_all == 1) {
204204
replace_cursor_positon ($('textarea[name="compose_body"]'));
205205
}
206-
else if (window.location.href.search('&forward=1') !== -1) {
206+
else if (routeParams.forward == 1) {
207207
replace_cursor_positon ($('textarea[name="compose_body"]'));
208208
setTimeout(function() {
209209
save_compose_state();

0 commit comments

Comments
 (0)