mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Don't clear searchValue on CommandDialog onBlur (#3172)
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
8ac3203924
commit
b2836eb57a
@ -35,6 +35,7 @@ import { clusterViewURL } from "../../../common/routes";
|
|||||||
@observer
|
@observer
|
||||||
export class CommandDialog extends React.Component {
|
export class CommandDialog extends React.Component {
|
||||||
@observable menuIsOpen = true;
|
@observable menuIsOpen = true;
|
||||||
|
@observable searchValue: any = undefined;
|
||||||
|
|
||||||
constructor(props: {}) {
|
constructor(props: {}) {
|
||||||
super(props);
|
super(props);
|
||||||
@ -104,14 +105,24 @@ export class CommandDialog extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<Select
|
<Select
|
||||||
menuPortalTarget={null}
|
menuPortalTarget={null}
|
||||||
onChange={(v) => this.onChange(v.value)}
|
onChange={v => this.onChange(v.value)}
|
||||||
components={{ DropdownIndicator: null, IndicatorSeparator: null }}
|
components={{
|
||||||
|
DropdownIndicator: null,
|
||||||
|
IndicatorSeparator: null,
|
||||||
|
}}
|
||||||
menuIsOpen={this.menuIsOpen}
|
menuIsOpen={this.menuIsOpen}
|
||||||
options={this.options}
|
options={this.options}
|
||||||
autoFocus={true}
|
autoFocus={true}
|
||||||
escapeClearsValue={false}
|
escapeClearsValue={false}
|
||||||
data-test-id="command-palette-search"
|
data-test-id="command-palette-search"
|
||||||
placeholder="Type a command or search…" />
|
placeholder="Type a command or search…"
|
||||||
|
onInputChange={(newValue, { action }) => {
|
||||||
|
if (action === "input-change") {
|
||||||
|
this.searchValue = newValue;
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
inputValue={this.searchValue}
|
||||||
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user