Elastic: Fix inserting responses at cursor position (#6971)

Don't check if the field has focus for text selection.
pull/6977/head
Aleksander Machniak 5 years ago
parent 57960b1cab
commit ce70166d9e

@ -4,6 +4,7 @@ CHANGELOG Roundcube Webmail
- Elastic: Resizeable columns (#6929)
- Elastic: Fix position and style of auto-complete dropdown on small screens (#6951)
- Elastic: Fix initial focus on recipients input in mail compose screen
- Elastic: Fix inserting responses at cursor position (#6971)
- Redis: Improve error handling and phpredis 5.X support (#6888)
- Archive: Fix bug where next email was not displayed after Archive button use (#6965)
- Archive: Fix missing Archive icon in folder selector popup in Elastic

@ -456,7 +456,7 @@ function rcube_text_editor(config, id)
}
// replace selection in compose textarea
else if (ed = rcube_find_object(this.id)) {
var selection = $(ed).is(':focus') ? rcmail.get_input_selection(ed) : {start: 0, end: 0},
var selection = rcmail.get_input_selection(ed),
value = ed.value,
pre = value.substring(0, selection.start),
end = value.substring(selection.end, value.length);
@ -515,7 +515,7 @@ function rcube_text_editor(config, id)
}
// get selected text from compose textarea
else if (ed = rcube_find_object(this.id)) {
if (args.selection && $(ed).is(':focus')) {
if (args.selection) {
text = rcmail.get_input_selection(ed).text;
}

Loading…
Cancel
Save