You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-05 23:10:41 +03:00
Fix enter in new room list filter breaking things
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
@@ -269,7 +269,7 @@ export default class LeftPanel2 extends React.Component<IProps, IState> {
|
|||||||
const firstRoom = this.listContainerRef.current.querySelector<HTMLDivElement>(".mx_RoomTile2");
|
const firstRoom = this.listContainerRef.current.querySelector<HTMLDivElement>(".mx_RoomTile2");
|
||||||
if (firstRoom) {
|
if (firstRoom) {
|
||||||
firstRoom.click();
|
firstRoom.click();
|
||||||
this.onSearch(""); // clear the search field
|
return true; // to get the field to clear
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -107,7 +107,13 @@ export default class RoomSearch extends React.PureComponent<IProps, IState> {
|
|||||||
} else if (ev.key === Key.ARROW_UP || ev.key === Key.ARROW_DOWN) {
|
} else if (ev.key === Key.ARROW_UP || ev.key === Key.ARROW_DOWN) {
|
||||||
this.props.onVerticalArrow(ev);
|
this.props.onVerticalArrow(ev);
|
||||||
} else if (ev.key === Key.ENTER) {
|
} else if (ev.key === Key.ENTER) {
|
||||||
this.props.onEnter(ev);
|
const shouldClear = this.props.onEnter(ev);
|
||||||
|
if (shouldClear) {
|
||||||
|
// wrap in set immediate to delay it so that we don't clear the filter & then change room
|
||||||
|
setImmediate(() => {
|
||||||
|
this.clearInput();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ import { isNullOrUndefined } from "matrix-js-sdk/src/utils";
|
|||||||
import RoomListLayoutStore from "./RoomListLayoutStore";
|
import RoomListLayoutStore from "./RoomListLayoutStore";
|
||||||
import { MarkedExecution } from "../../utils/MarkedExecution";
|
import { MarkedExecution } from "../../utils/MarkedExecution";
|
||||||
import { AsyncStoreWithClient } from "../AsyncStoreWithClient";
|
import { AsyncStoreWithClient } from "../AsyncStoreWithClient";
|
||||||
import { MatrixClientPeg } from "../../MatrixClientPeg";
|
|
||||||
|
|
||||||
interface IState {
|
interface IState {
|
||||||
tagsEnabled?: boolean;
|
tagsEnabled?: boolean;
|
||||||
|
|||||||
Reference in New Issue
Block a user