Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
#30 fixed stopped triggering form submission
Browse files Browse the repository at this point in the history
  • Loading branch information
mohbasheer committed Feb 6, 2017
1 parent e936d70 commit 96f80c9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-chips",
"version": "1.0.9",
"version": "1.0.10",
"homepage": "https://github.com/mohbasheer/angular-chips",
"authors": [
"Mohammed Basheer"
Expand Down
4 changes: 2 additions & 2 deletions dist/angular-chips.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,8 @@
/*@ngInject*/
function ChipControlLinkFun(scope, iElement, iAttrs, chipsCtrl) {
iElement.on('keypress', function(event) {
if (event.keyCode === 13 && event.target.value !== '') {
if (chipsCtrl.addChip(event.target.value)) {
if (event.keyCode === 13) {
if (event.target.value !== '' && chipsCtrl.addChip(event.target.value)) {
event.target.value = "";
}
event.preventDefault();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-chips",
"version": "1.0.9",
"version": "1.0.10",
"description": "Angular-Chips is the angular based component. You can use it to add dynamic chips or free form tags. check samples directory for more information.",
"author": "Mohammed Basheer",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions src/js/directives/controls/chip_control.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
/*@ngInject*/
function ChipControlLinkFun(scope, iElement, iAttrs, chipsCtrl) {
iElement.on('keypress', function(event) {
if (event.keyCode === 13 && event.target.value !== '') {
if (chipsCtrl.addChip(event.target.value)) {
if (event.keyCode === 13) {
if (event.target.value !== '' && chipsCtrl.addChip(event.target.value)) {
event.target.value = "";
}
event.preventDefault();
Expand Down

0 comments on commit 96f80c9

Please sign in to comment.