mirror of
https://github.com/thelounge/thelounge
synced 2024-11-10 22:54:15 +00:00
Make sure input height is reset when submitting with icon
This is especially noticeable on mobile, where clicking Send icon is more natural.
This commit is contained in:
parent
facf306045
commit
dd02f0f029
1 changed files with 6 additions and 1 deletions
|
@ -631,6 +631,10 @@ $(function() {
|
|||
return false;
|
||||
});
|
||||
|
||||
function resetInputHeight(input) {
|
||||
input.style.height = input.style.minHeight;
|
||||
}
|
||||
|
||||
var input = $("#input")
|
||||
.history()
|
||||
.on("input keyup", function() {
|
||||
|
@ -638,7 +642,7 @@ $(function() {
|
|||
|
||||
// Start by resetting height before computing as scrollHeight does not
|
||||
// decrease when deleting characters
|
||||
this.style.height = this.style.minHeight;
|
||||
resetInputHeight(this);
|
||||
|
||||
this.style.height = Math.min(
|
||||
Math.round(window.innerHeight - 100), // prevent overflow
|
||||
|
@ -662,6 +666,7 @@ $(function() {
|
|||
}
|
||||
|
||||
input.val("");
|
||||
resetInputHeight(input.get(0));
|
||||
|
||||
if (text.indexOf("/clear") === 0) {
|
||||
clear();
|
||||
|
|
Loading…
Reference in a new issue