forked from matrix/element-web
let's wrap when you go off the beginning
This commit is contained in:
parent
960a38fe43
commit
316a28838f
|
@ -182,12 +182,12 @@ module.exports = {
|
|||
|
||||
var self = this;
|
||||
setTimeout(function() {
|
||||
if (self.refs.textarea.getDOMNode().value != '') {
|
||||
if (self.refs.textarea && self.refs.textarea.getDOMNode().value != '') {
|
||||
self.onTypingActivity();
|
||||
} else {
|
||||
self.onFinishedTyping();
|
||||
}
|
||||
}, 10);
|
||||
}, 10); // XXX: what is this 10ms setTimeout doing? Looks hacky :(
|
||||
},
|
||||
|
||||
onEnter: function(ev) {
|
||||
|
|
|
@ -166,7 +166,8 @@ module.exports = {
|
|||
break;
|
||||
}
|
||||
}
|
||||
roomIndex = Math.max((roomIndex + roomIndexDelta) % allRooms.length, 0);
|
||||
roomIndex = (roomIndex + roomIndexDelta) % allRooms.length;
|
||||
if (roomIndex < 0) roomIndex = allRooms.length - 1;
|
||||
this.focusComposer = true;
|
||||
this.setState({
|
||||
currentRoom: allRooms[roomIndex].roomId
|
||||
|
@ -250,10 +251,12 @@ module.exports = {
|
|||
case 38:
|
||||
dis.dispatch({action: 'view_prev_room'});
|
||||
ev.stopPropagation();
|
||||
ev.preventDefault();
|
||||
break;
|
||||
case 40:
|
||||
dis.dispatch({action: 'view_next_room'});
|
||||
ev.stopPropagation();
|
||||
ev.preventDefault();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue