Skip to content

Commit

Permalink
use onInput instead of onChange
Browse files Browse the repository at this point in the history
  • Loading branch information
fenglish committed Dec 18, 2018
1 parent d14273d commit 259c3dd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion __tests__/__snapshots__/snapshots.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5555,9 +5555,9 @@ exports[`@financial-times/x-topic-search renders a default Topic Search Bar x-to
data-trackable="topic-search"
id="topic-search-input"
onBlur={[Function]}
onChange={[Function]}
onClick={[Function]}
onFocus={[Function]}
onInput={[Function]}
placeholder="Search and add topics"
type="search"
/>
Expand Down
6 changes: 3 additions & 3 deletions components/x-topic-search/__tests__/x-topic-search.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('x-topic-search', () => {

const subject = mount(<TopicSearch {...props}/>);
const input = subject.find('input');
await input.prop('onChange')({ target: { value: searchTerm }});
await input.prop('onInput')({ target: { value: searchTerm }});

expect(subject.render()).toMatchSnapshot();
})
Expand All @@ -43,7 +43,7 @@ describe('x-topic-search', () => {

const subject = mount(<TopicSearch {...props}/>);
const input = subject.find('input');
await input.prop('onChange')({ target: { value: searchTerm }});
await input.prop('onInput')({ target: { value: searchTerm }});

expect(subject.render()).toMatchSnapshot();
})
Expand All @@ -60,7 +60,7 @@ describe('x-topic-search', () => {

const subject = mount(<TopicSearch {...props}/>);
const input = subject.find('input');
await input.prop('onChange')({ target: { value: searchTerm }});
await input.prop('onInput')({ target: { value: searchTerm }});

expect(subject.render()).toMatchSnapshot();
})
Expand Down
2 changes: 1 addition & 1 deletion components/x-topic-search/src/TopicSearch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const TopicSearch = topicSearchActions(({ searchTerm, showResult, result, action
placeholder="Search and add topics"
className={ classNames(styles["input"]) }
data-trackable="topic-search"
onChange={ actions.checkInput }
onInput={ actions.checkInput }
onClick={ actions.selectInput }
onFocus={ actions.selectInput }
onBlur={ actions.hideResult }/>
Expand Down

0 comments on commit 259c3dd

Please sign in to comment.