scroll down when showing typing notif and stuck at bottom
This commit is contained in:
parent
e2c57ba2ef
commit
8ddd2dd078
2 changed files with 18 additions and 2 deletions
|
@ -631,6 +631,13 @@ module.exports = React.createClass({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_scrollDownIfAtBottom: function() {
|
||||||
|
const scrollPanel = this.refs.scrollPanel;
|
||||||
|
if (scrollPanel) {
|
||||||
|
scrollPanel.checkScroll();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
onResize: function() {
|
onResize: function() {
|
||||||
dis.dispatch({ action: 'timeline_resize' }, true);
|
dis.dispatch({ action: 'timeline_resize' }, true);
|
||||||
},
|
},
|
||||||
|
@ -667,7 +674,7 @@ module.exports = React.createClass({
|
||||||
stickyBottom={this.props.stickyBottom}>
|
stickyBottom={this.props.stickyBottom}>
|
||||||
{ topSpinner }
|
{ topSpinner }
|
||||||
{ this._getEventTiles() }
|
{ this._getEventTiles() }
|
||||||
<WhoIsTypingTile room={this.props.room} />
|
<WhoIsTypingTile room={this.props.room} onVisible={this._scrollDownIfAtBottom} />
|
||||||
{ bottomSpinner }
|
{ bottomSpinner }
|
||||||
</ScrollPanel>
|
</ScrollPanel>
|
||||||
);
|
);
|
||||||
|
|
|
@ -29,7 +29,7 @@ module.exports = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
// the room this statusbar is representing.
|
// the room this statusbar is representing.
|
||||||
room: PropTypes.object.isRequired,
|
room: PropTypes.object.isRequired,
|
||||||
|
onVisible: PropTypes.func,
|
||||||
// Number of names to display in typing indication. E.g. set to 3, will
|
// Number of names to display in typing indication. E.g. set to 3, will
|
||||||
// result in "X, Y, Z and 100 others are typing."
|
// result in "X, Y, Z and 100 others are typing."
|
||||||
whoIsTypingLimit: PropTypes.number,
|
whoIsTypingLimit: PropTypes.number,
|
||||||
|
@ -51,6 +51,15 @@ module.exports = React.createClass({
|
||||||
MatrixClientPeg.get().on("RoomMember.typing", this.onRoomMemberTyping);
|
MatrixClientPeg.get().on("RoomMember.typing", this.onRoomMemberTyping);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
componentDidUpdate: function(_, prevState) {
|
||||||
|
if (this.props.onVisible &&
|
||||||
|
!prevState.usersTyping.length &&
|
||||||
|
this.state.usersTyping.length)
|
||||||
|
{
|
||||||
|
this.props.onVisible();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
componentWillUnmount: function() {
|
componentWillUnmount: function() {
|
||||||
// we may have entirely lost our client as we're logging out before clicking login on the guest bar...
|
// we may have entirely lost our client as we're logging out before clicking login on the guest bar...
|
||||||
const client = MatrixClientPeg.get();
|
const client = MatrixClientPeg.get();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue