Fix Shortcut prompt for Search showing in minimized Roomlist (#9014)
This commit is contained in:
parent
4844cc14bd
commit
39816f67e4
4 changed files with 41 additions and 80 deletions
|
@ -304,14 +304,6 @@ export default class LeftPanel extends React.Component<IProps, IState> {
|
|||
}
|
||||
};
|
||||
|
||||
private selectRoom = () => {
|
||||
const firstRoom = this.listContainerRef.current.querySelector<HTMLDivElement>(".mx_RoomTile");
|
||||
if (firstRoom) {
|
||||
firstRoom.click();
|
||||
return true; // to get the field to clear
|
||||
}
|
||||
};
|
||||
|
||||
private renderBreadcrumbs(): React.ReactNode {
|
||||
if (this.state.showBreadcrumbs === BreadcrumbsMode.Legacy && !this.props.isMinimized) {
|
||||
return (
|
||||
|
@ -357,10 +349,7 @@ export default class LeftPanel extends React.Component<IProps, IState> {
|
|||
onBlur={this.onBlur}
|
||||
onKeyDown={this.onKeyDown}
|
||||
>
|
||||
<RoomSearch
|
||||
isMinimized={this.props.isMinimized}
|
||||
onSelectRoom={this.selectRoom}
|
||||
/>
|
||||
<RoomSearch isMinimized={this.props.isMinimized} />
|
||||
|
||||
{ dialPadButton }
|
||||
{ rightButton }
|
||||
|
|
|
@ -28,10 +28,6 @@ import AccessibleButton from "../views/elements/AccessibleButton";
|
|||
|
||||
interface IProps {
|
||||
isMinimized: boolean;
|
||||
/**
|
||||
* @returns true if a room has been selected and the search field should be cleared
|
||||
*/
|
||||
onSelectRoom(): boolean;
|
||||
}
|
||||
|
||||
export default class RoomSearch extends React.PureComponent<IProps> {
|
||||
|
@ -67,9 +63,9 @@ export default class RoomSearch extends React.PureComponent<IProps> {
|
|||
<div className="mx_RoomSearch_icon" />
|
||||
);
|
||||
|
||||
const shortcutPrompt = <div className="mx_RoomSearch_shortcutPrompt">
|
||||
const shortcutPrompt = <kbd className="mx_RoomSearch_shortcutPrompt">
|
||||
{ IS_MAC ? "⌘ K" : _t(ALTERNATE_KEY_NAME[Key.CONTROL]) + " K" }
|
||||
</div>;
|
||||
</kbd>;
|
||||
|
||||
return <AccessibleButton onClick={this.openSpotlight} className={classes}>
|
||||
{ icon }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue