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

This commit is contained in:
schlagmichdoch 2023-10-09 17:54:26 +02:00 committed by schlagmichdoch
parent 3c1ef57740
commit 1669fe7d75
6 changed files with 10 additions and 12 deletions

View file

@ -372,7 +372,7 @@
</div>
<div class="row">
<div class="column fw">
<div id="text-input" title="Message" class="textarea" role="textbox" autocapitalize="none" spellcheck="false" autofocus contenteditable></div>
<textarea title="Message" class="textarea" wrap="off" autofocus></textarea>
</div>
</div>
<div class="button-row row-reverse">

View file

@ -1726,7 +1726,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('#text-input');
this.$text = this.$el.querySelector('.textarea');
this.$peerDisplayName = this.$el.querySelector('.display-name');
this.$form = this.$el.querySelector('form');
this.$submit = this.$el.querySelector('button[type="submit"]');
@ -1747,7 +1747,7 @@ class SendTextDialog extends Dialog {
}
_textInputEmpty() {
return !this.$text.innerText || this.$text.innerText === "\n";
return !this.$text.value || this.$text.value === "\n";
}
_onChange(e) {
@ -1769,7 +1769,6 @@ class SendTextDialog extends Dialog {
const range = document.createRange();
const sel = window.getSelection();
this.$text.focus();
range.selectNodeContents(this.$text);
sel.removeAllRanges();
sel.addRange(range);
@ -1783,7 +1782,7 @@ class SendTextDialog extends Dialog {
_send() {
Events.fire('send-text', {
to: this.correspondingPeerId,
text: this.$text.innerText
text: this.$text.value
});
this.$text.value = "";
this.hide();

View file

@ -1041,7 +1041,7 @@ x-dialog .dialog-subheader {
padding-bottom: 0;
}
#text-input {
#send-text-dialog .textarea {
min-height: 200px;
width: 100%;
}