Trim spurious whitespace of "Explore rooms" menu input (#7431)

* Trim spurious whitespace of "Explore rooms" menu input

Trims the whitespace around the input string in order to
show relevant room suggestions and the "Join" button.

Fixes https://github.com/vector-im/element-web/issues/19728

Signed-off by: Ingrid Budau inigiri@posteo.jp

* Add safe navigation

Co-authored-by: Travis Ralston <travpc@gmail.com>

Co-authored-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
Ingrid 2021-12-22 17:16:51 +01:00 committed by GitHub
parent cd04799cb4
commit defbe16448
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -393,7 +393,7 @@ export default class RoomDirectory extends React.Component<IProps, IState> {
private onFilterChange = (alias: string) => { private onFilterChange = (alias: string) => {
this.setState({ this.setState({
filterString: alias || "", filterString: alias?.trim() || "",
}); });
// don't send the request for a little bit, // don't send the request for a little bit,