You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-10 09:22:25 +03:00
Basic keyboard scrolling of queryList
This commit is contained in:
@@ -68,6 +68,12 @@ module.exports = React.createClass({
|
|||||||
this._updateUserList();
|
this._updateUserList();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
componentDidUpdate: function() {
|
||||||
|
// As the user scrolls with the arrow keys keep the selected item
|
||||||
|
// at the top of the window. Each item is 29px high.
|
||||||
|
this.scrollElement.scrollTop = this.state.selected * 29;
|
||||||
|
},
|
||||||
|
|
||||||
onStartChat: function() {
|
onStartChat: function() {
|
||||||
if (this.state.user) {
|
if (this.state.user) {
|
||||||
this._startChat(this.state.user.userId);
|
this._startChat(this.state.user.userId);
|
||||||
@@ -251,7 +257,7 @@ module.exports = React.createClass({
|
|||||||
var queryListElements = this.createQueryListTiles();
|
var queryListElements = this.createQueryListTiles();
|
||||||
if (queryListElements.length > 0) {
|
if (queryListElements.length > 0) {
|
||||||
queryList = (
|
queryList = (
|
||||||
<div className="mx_ChatInviteDialog_queryList">
|
<div className="mx_ChatInviteDialog_queryList" ref={(ref) => {this.scrollElement = ref}}>
|
||||||
{ queryListElements }
|
{ queryListElements }
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user