Skip to content

Commit

Permalink
Fix: Query editor duplicates keystrokes [#2972]
Browse files Browse the repository at this point in the history
  • Loading branch information
ranbena committed Jan 1, 2019
1 parent 0449a3f commit 7a60d95
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion client/app/components/QueryEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,14 @@ class QueryEditor extends React.Component {

static getDerivedStateFromProps(nextProps, prevState) {
if (!nextProps.schema) {
return { keywords: [], liveAutocompleteDisabled: false };
return {
keywords: {
table: [],
column: [],
tableColumn: [],
},
liveAutocompleteDisabled: false,
};
} else if (nextProps.schema !== prevState.schema) {
const tokensCount = nextProps.schema.reduce((totalLength, table) => totalLength + table.columns.length, 0);
return {
Expand Down

0 comments on commit 7a60d95

Please sign in to comment.