Fix some input issues on mobile

This commit is contained in:
Pavel Djundik 2018-07-16 19:43:25 +03:00 committed by Pavel Djundik
parent 86ddce974d
commit d00c70f804

View file

@ -61,7 +61,7 @@
<script> <script>
require("intersection-observer"); require("intersection-observer");
import {debounce, throttle} from "lodash"; import {throttle} from "lodash";
const constants = require("../js/constants"); const constants = require("../js/constants");
const clipboard = require("../js/clipboard"); const clipboard = require("../js/clipboard");
@ -122,6 +122,12 @@ export default {
"channel.messages"() { "channel.messages"() {
this.keepScrollPosition(); this.keepScrollPosition();
}, },
"channel.pendingMessage"() {
this.$nextTick(() => {
// Keep the scroll stuck when input gets resized while typing
this.keepScrollPosition();
});
},
}, },
created() { created() {
this.$nextTick(() => { this.$nextTick(() => {
@ -140,7 +146,7 @@ export default {
}); });
}, },
mounted() { mounted() {
this.debouncedResize = debounce(this.handleResize, 500); this.debouncedResize = throttle(this.handleResize, 500);
this.debouncedScroll = throttle(this.handleScroll, 150); this.debouncedScroll = throttle(this.handleScroll, 150);
window.addEventListener("resize", this.debouncedResize, {passive: true}); window.addEventListener("resize", this.debouncedResize, {passive: true});