mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-05 20:26:19 +02:00
relayout whenever the input textarea's scrollheight increases
This commit is contained in:
parent
152872b342
commit
0d1c06d586
@ -34,6 +34,8 @@ var TYPING_USER_TIMEOUT = 10000;
|
||||
var TYPING_SERVER_TIMEOUT = 30000;
|
||||
|
||||
module.exports = {
|
||||
oldScrollHeight: 0,
|
||||
|
||||
componentWillMount: function() {
|
||||
this.tabStruct = {
|
||||
completing: false,
|
||||
@ -211,16 +213,14 @@ module.exports = {
|
||||
// kick gemini-scrollbar to re-layout
|
||||
this.props.roomView.forceUpdate();
|
||||
}
|
||||
this.oldScrollHeight = this.refs.textarea.scrollHeight;
|
||||
},
|
||||
|
||||
onKeyUp: function(ev) {
|
||||
if (ev.keyCode === KeyCode.ENTER ||
|
||||
if (this.refs.textarea.scrollHeight !== this.oldScrollHeight ||
|
||||
ev.keyCode === KeyCode.DELETE ||
|
||||
ev.keyCode === KeyCode.BACKSPACE)
|
||||
{
|
||||
// resize to fit.
|
||||
// XXX: ideally we should fire this onChange, but as it's fairly heavy we
|
||||
// optimise and only resie on enter or delete/backspace.
|
||||
this.resizeInput();
|
||||
}
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user