Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Now you can submit pressing shift+enter #110

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

ManuelMolina97
Copy link
Contributor

#93

if (event.charCode === 13 && event.shiftKey) {
this.save();
this.onEscape(event);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

if and else do the same action (this.save() and this.onEscape(event)) then is not necessary if-else. You would rethink the condition using an OR operator maybe.

If you have problems with this logic, contact me and can rethink together.

Copy link
Collaborator

@Caballerog Caballerog left a comment

Choose a reason for hiding this comment

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

if and else do the same action (this.save() and this.onEscape(event)) then is not necessary if-else. You would rethink the condition using an OR operator maybe.

If you have problems with this logic, contact me and can rethink together.

Copy link
Collaborator

@Caballerog Caballerog left a comment

Choose a reason for hiding this comment

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

(A && B && !C) || (!A && B && C)

What's the common factor? ;-)

super.onKeyPress(event);
if ((this.config.saveOnEnter && event.charCode === 13 && !event.shiftKey) ||
(!this.config.saveOnEnter && event.charCode === 13 && event.shiftKey)) {
this.save();
Copy link
Collaborator

Choose a reason for hiding this comment

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

(A && B && !C) || (!A && B && C)

What's the common factor? ;-)

@alisalama
Copy link

alisalama commented May 24, 2018

@xxxTonixxx, any chance of merging the pull request? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants