Merge pull request #1327 from scm-manager/bugfix/repository-search-reset

update filter value on props change
This commit is contained in:
eheimbuch
2020-09-10 11:32:48 +02:00
committed by GitHub
2 changed files with 11 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Redirection to requested page after login in anonymous mode
- Update filter state on property change ([#1327](https://github.com/scm-manager/scm-manager/pull/1327))
- Diff view for svn now handles whitespaces in filenames properly ([1325](https://github.com/scm-manager/scm-manager/pull/1325))
- Validate new namespace on repository rename ([#1322](https://github.com/scm-manager/scm-manager/pull/1322))

View File

@@ -59,6 +59,16 @@ class FilterInput extends React.Component<Props, State> {
event.preventDefault();
};
componentDidUpdate = ({ value: oldValue }: Props) => {
const { value: newValue } = this.props;
const { value: stateValue } = this.state;
if (oldValue !== newValue && newValue !== stateValue) {
this.setState({
value: newValue || ""
});
}
};
render() {
const { t, testId } = this.props;
return (