Skip to content

Commit

Permalink
WIP - oops, that's what "current" is for.
Browse files Browse the repository at this point in the history
clearing the search, obvsly.
  • Loading branch information
mvollmer committed Sep 19, 2024
1 parent 5c02e8c commit ae6af7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/shell/hosts.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ export class CockpitHosts extends React.Component {
item_render={render}
sorting={(a, b) => true}
filtering={this.filterHosts}
current={label}
jump={() => console.error("internal error: jump not supported in hosts selector")}
/>
<div className="nav-hosts-actions">
Expand Down
3 changes: 3 additions & 0 deletions pkg/shell/nav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export class CockpitNav extends React.Component {

this.state = {
search: "",
current: props.current,
};

this.clearSearch = this.clearSearch.bind(this);
Expand Down Expand Up @@ -114,6 +115,7 @@ export class CockpitNav extends React.Component {
if (nextProps.current !== prevState.current)
return {
search: "",
current: nextProps.current,
};
return null;
}
Expand Down Expand Up @@ -360,5 +362,6 @@ export const PageNav = ({
item_render={nav_item}
filtering={keyword_filter}
sorting={(a, b) => { return b.keyword.score - a.keyword.score }}
current={component}
jump={jump} />;
};

0 comments on commit ae6af7c

Please sign in to comment.