Revert "fix textarea for sending messages is not editable on some iOS devices (#163)"

This reverts commit 1669fe7d75.
This commit is contained in:
schlagmichdoch 2023-10-11 18:56:07 +02:00
parent d46f57d8ec
commit 38a80d2d34
6 changed files with 12 additions and 10 deletions

View file

@ -1724,7 +1724,7 @@ class SendTextDialog extends Dialog {
constructor() {
super('send-text-dialog');
Events.on('text-recipient', e => this._onRecipient(e.detail.peerId, e.detail.deviceName));
this.$text = this.$el.querySelector('.textarea');
this.$text = this.$el.querySelector('#text-input');
this.$peerDisplayName = this.$el.querySelector('.display-name');
this.$form = this.$el.querySelector('form');
this.$submit = this.$el.querySelector('button[type="submit"]');
@ -1745,7 +1745,7 @@ class SendTextDialog extends Dialog {
}
_textInputEmpty() {
return !this.$text.value || this.$text.value === "\n";
return !this.$text.innerText || this.$text.innerText === "\n";
}
_onChange(e) {
@ -1767,6 +1767,7 @@ class SendTextDialog extends Dialog {
const range = document.createRange();
const sel = window.getSelection();
this.$text.focus();
range.selectNodeContents(this.$text);
sel.removeAllRanges();
sel.addRange(range);
@ -1780,7 +1781,7 @@ class SendTextDialog extends Dialog {
_send() {
Events.fire('send-text', {
to: this.correspondingPeerId,
text: this.$text.value
text: this.$text.innerText
});
this.$text.value = "";
this.hide();