From f29a01e226a8d1ae737fa10a63ccee4691d2bc8d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Kuty=C5=82a?= Date: Fri, 10 Dec 2021 16:12:09 +0100 Subject: [PATCH] 17579: added check if search input contains value MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła --- cypress/integration/project.spec.js | 2 +- src/components/search-input/search-input.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/integration/project.spec.js b/cypress/integration/project.spec.js index b3d6bbed..23e1ba24 100644 --- a/cypress/integration/project.spec.js +++ b/cypress/integration/project.spec.js @@ -64,7 +64,7 @@ describe('Project tests', function() { .then(function() { expect(this.projects).to.have.lengthOf(1); expect(this.projects[0].properties).to.deep.equal( - {IDTAGCOLORS: 'IDVALCOLORS3'}); + { Color: 'Magenta' }); }); }); diff --git a/src/components/search-input/search-input.tsx b/src/components/search-input/search-input.tsx index 955cf5e5..50338f40 100644 --- a/src/components/search-input/search-input.tsx +++ b/src/components/search-input/search-input.tsx @@ -97,7 +97,7 @@ export const SearchInput = withStyles(styles)( if (nextProps.value !== this.props.value) { this.setState({ value: nextProps.value }); } - if (nextProps.selfClearProp !== this.state.selfClearProp) { + if (this.state.value !== '' && nextProps.selfClearProp && nextProps.selfClearProp !== this.state.selfClearProp) { this.props.onSearch(''); this.setState({ selfClearProp: nextProps.selfClearProp }); } -- 2.30.2