mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 21:24:59 +08:00
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;
|
var self = this;
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
if (self.refs.textarea.getDOMNode().value != '') {
|
if (self.refs.textarea && self.refs.textarea.getDOMNode().value != '') {
|
||||||
self.onTypingActivity();
|
self.onTypingActivity();
|
||||||
} else {
|
} else {
|
||||||
self.onFinishedTyping();
|
self.onFinishedTyping();
|
||||||
}
|
}
|
||||||
}, 10);
|
}, 10); // XXX: what is this 10ms setTimeout doing? Looks hacky :(
|
||||||
},
|
},
|
||||||
|
|
||||||
onEnter: function(ev) {
|
onEnter: function(ev) {
|
||||||
|
@ -166,7 +166,8 @@ module.exports = {
|
|||||||
break;
|
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.focusComposer = true;
|
||||||
this.setState({
|
this.setState({
|
||||||
currentRoom: allRooms[roomIndex].roomId
|
currentRoom: allRooms[roomIndex].roomId
|
||||||
@ -250,10 +251,12 @@ module.exports = {
|
|||||||
case 38:
|
case 38:
|
||||||
dis.dispatch({action: 'view_prev_room'});
|
dis.dispatch({action: 'view_prev_room'});
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
|
ev.preventDefault();
|
||||||
break;
|
break;
|
||||||
case 40:
|
case 40:
|
||||||
dis.dispatch({action: 'view_next_room'});
|
dis.dispatch({action: 'view_next_room'});
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
|
ev.preventDefault();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user