Skip to content

Now you can submit pressing shift+enter - #110

Open
ManuelMolina97 wants to merge 6 commits into
qontu:masterfrom
ManuelMolina97:master
Open

Now you can submit pressing shift+enter#110
ManuelMolina97 wants to merge 6 commits into
qontu:masterfrom
ManuelMolina97:master

Conversation

@ManuelMolina97

Copy link
Copy Markdown
Contributor

#93

Comment thread src/inputs/input-textarea.component.ts Outdated
if (event.charCode === 13 && event.shiftKey) {
this.save();
this.onEscape(event);
}

Copy link
Copy Markdown
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.

@Caballerog Caballerog left a comment

Copy link
Copy Markdown
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.

@Caballerog Caballerog left a comment

Copy link
Copy Markdown
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? ;-)

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

Copy link
Copy Markdown
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

alisalama commented May 24, 2018

Copy link
Copy Markdown

@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.

3 participants