Improve <NamespaceSelectFilter>'s UX (#3490)

- Display previously selected namespaces at the top of the option list
  when first opened

- Don't resort after every selection

- Automatically close the option list if no longer in multi-select mode
  and have toggled at least one namespace

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton authored and GitHub committed 2021-07-27 08:53:34 -04:00
1 parent 91b3bd10ee
commit 51b53b3349
3 files changed
+84 -22

No files matched your search

+2 -2
View File
@@ -115,8 +115,8 @@ export class Input extends React.Component<InputProps, State> {
}
getValue(): string {
const { trim, value, defaultValue = "" } = this.props;
const rawValue = value ?? this.input?.value ?? defaultValue;
const { trim, value, defaultValue } = this.props;
const rawValue = value ?? this.input?.value ?? defaultValue ?? "";
return trim ? rawValue.trim() : rawValue;
}