Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

- force value change on 'enter', not just lost focus#52

Merged
Marc-Andre-Rivet merged 7 commits intomasterfrom
3.0-issue50-enter-in-last-row
Aug 29, 2018
Merged

- force value change on 'enter', not just lost focus#52
Marc-Andre-Rivet merged 7 commits intomasterfrom
3.0-issue50-enter-in-last-row

Conversation

@Marc-Andre-Rivet
Copy link
Copy Markdown
Contributor

@Marc-Andre-Rivet Marc-Andre-Rivet commented Aug 27, 2018

Fix for issue:
#50

- fix demo bug that merges state updates incorrectly
demo/App.js Outdated
});
this.setState(prevState => ({
tableProps: merge(prevState.tableProps, newProps)
}));
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sometimes the state gets changed multiple times in short succession, React doesn't have time to update the state between the calls and changes get lost.


// catch CTRL but not right ALT (which in some systems triggers ALT+CTRL)
export const isCtrlDown = e => (e.ctrlKey || e.metaKey) && !e.altKey;
export const isCtrlDown = (e: KeyboardEvent) => (e.ctrlKey || e.metaKey) && !e.altKey;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Easy switch to Typescript


DOM.focused.type(`abc${Key.Enter}`);

cy.get('#container').should('have.value', `[249][0] = ${initialValue} -> abc${initialValue}`);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The BE will update the container field if 'Enter' triggered the df update as it should be.

@Marc-Andre-Rivet
Copy link
Copy Markdown
Contributor Author

Please review if you have some time @VeraZab @T4rk1n @valentijnnieman @wbrgss. Thx.

Copy link
Copy Markdown
Contributor

@T4rk1n T4rk1n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💃 looks good to me.

if dataframe is None or previous is None:
return modification

for (y, row) in enumerate(dataframe):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need the () when unpacking.

@Marc-Andre-Rivet Marc-Andre-Rivet merged commit faa5e19 into master Aug 29, 2018
@Marc-Andre-Rivet Marc-Andre-Rivet deleted the 3.0-issue50-enter-in-last-row branch September 27, 2018 15:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants