forked from mystiq/hydrogen-web
Convert input to textarea
Signed-off-by: RMidhunSuresh <hi@midhun.dev>
This commit is contained in:
parent
abb802b881
commit
16bec0a656
1 changed files with 3 additions and 3 deletions
|
@ -28,11 +28,11 @@ export class MessageComposer extends TemplateView {
|
||||||
}
|
}
|
||||||
|
|
||||||
render(t, vm) {
|
render(t, vm) {
|
||||||
this._input = t.input({
|
this._input = t.textarea({
|
||||||
placeholder: vm.isEncrypted ? "Send an encrypted message…" : "Send a message…",
|
|
||||||
enterkeyhint: 'send',
|
enterkeyhint: 'send',
|
||||||
onKeydown: e => this._onKeyDown(e),
|
onKeydown: e => this._onKeyDown(e),
|
||||||
onInput: () => vm.setInput(this._input.value),
|
onInput: () => vm.setInput(this._input.value),
|
||||||
|
placeholder: vm.isEncrypted ? "Send an encrypted message…" : "Send a message…"
|
||||||
});
|
});
|
||||||
this._focusInput = () => this._input.focus();
|
this._focusInput = () => this._input.focus();
|
||||||
this.value.on("focus", this._focusInput);
|
this.value.on("focus", this._focusInput);
|
||||||
|
@ -86,7 +86,7 @@ export class MessageComposer extends TemplateView {
|
||||||
}
|
}
|
||||||
|
|
||||||
_onKeyDown(event) {
|
_onKeyDown(event) {
|
||||||
if (event.key === "Enter") {
|
if (event.key === "Enter" && !event.shiftKey) {
|
||||||
this._trySend();
|
this._trySend();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue