Merge branch 'develop' into travis/room-list/css-layout

This commit is contained in:
Travis Ralston 2020-06-05 13:19:00 -06:00
commit ea6b0a60ab
7 changed files with 41 additions and 26 deletions

View file

@ -359,6 +359,8 @@ export default class BasicMessageEditor extends React.Component {
}
_onSelectionChange = () => {
const {isEmpty} = this.props.model;
this._refreshLastCaretIfNeeded();
const selection = document.getSelection();
if (this._hasTextSelected && selection.isCollapsed) {
@ -366,7 +368,7 @@ export default class BasicMessageEditor extends React.Component {
if (this._formatBarRef) {
this._formatBarRef.hide();
}
} else if (!selection.isCollapsed) {
} else if (!selection.isCollapsed && !isEmpty) {
this._hasTextSelected = true;
if (this._formatBarRef) {
const selectionRect = selection.getRangeAt(0).getBoundingClientRect();

View file

@ -217,11 +217,8 @@ export default class RoomSublist2 extends React.Component<IProps, IState> {
handles = []; // no handles, we're at a minimum
}
// TODO: Remove Math hacks
let nVisible = Math.floor(layout.visibleTiles);
if (localStorage.getItem("mx_rl_mathfn")) {
nVisible = Math[localStorage.getItem("mx_rl_mathfn")](layout.visibleTiles);
}
// TODO: This might need adjustment, however for now it is fine as a round.
const nVisible = Math.round(layout.visibleTiles);
const visibleTiles = tiles.slice(0, nVisible);
// If we're hiding rooms, show a 'show more' button to the user. This button
@ -233,10 +230,12 @@ export default class RoomSublist2 extends React.Component<IProps, IState> {
// we have a cutoff condition - add the button to show all
// we +1 to account for the room we're about to hide with our 'show more' button
// this results in the button always being 1+, and not needing an i18n `count`.
const numMissing = (tiles.length - visibleTiles.length) + 1;
// TODO: CSS TBD
// TODO: Make this an actual tile
// TODO: This is likely to pop out of the list, consider that.
visibleTiles.splice(visibleTiles.length - 1, 1, (
<div
onClick={this.onShowAllClick}