Skip to content
Open
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/inputs/input-textarea.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,18 @@ export class InputTextareaComponent extends InputBase implements OnInit {
}

public config: InlineTextareaConfig;

public onKeyPress(event) {
if (this.config.saveOnEnter) {
if (event.charCode === 13 && !event.shiftKey) {
this.save();
this.onEscape(event);
}
} else {
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.

}
}
}