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

Commit 96f80c9

Browse files
committed
#30 fixed stopped triggering form submission
1 parent e936d70 commit 96f80c9

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-chips",
3-
"version": "1.0.9",
3+
"version": "1.0.10",
44
"homepage": "https://github.com/mohbasheer/angular-chips",
55
"authors": [
66
"Mohammed Basheer"

dist/angular-chips.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,8 @@
417417
/*@ngInject*/
418418
function ChipControlLinkFun(scope, iElement, iAttrs, chipsCtrl) {
419419
iElement.on('keypress', function(event) {
420-
if (event.keyCode === 13 && event.target.value !== '') {
421-
if (chipsCtrl.addChip(event.target.value)) {
420+
if (event.keyCode === 13) {
421+
if (event.target.value !== '' && chipsCtrl.addChip(event.target.value)) {
422422
event.target.value = "";
423423
}
424424
event.preventDefault();

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-chips",
3-
"version": "1.0.9",
3+
"version": "1.0.10",
44
"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.",
55
"author": "Mohammed Basheer",
66
"license": "MIT",

src/js/directives/controls/chip_control.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
/*@ngInject*/
1717
function ChipControlLinkFun(scope, iElement, iAttrs, chipsCtrl) {
1818
iElement.on('keypress', function(event) {
19-
if (event.keyCode === 13 && event.target.value !== '') {
20-
if (chipsCtrl.addChip(event.target.value)) {
19+
if (event.keyCode === 13) {
20+
if (event.target.value !== '' && chipsCtrl.addChip(event.target.value)) {
2121
event.target.value = "";
2222
}
2323
event.preventDefault();

0 commit comments

Comments
 (0)