From 2c6db751aa37d60861aaac6a0015073c5baf9043 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Wed, 21 Sep 2016 13:40:25 +0200 Subject: [PATCH] Prevent event propagation when press ENTER in the color selector --- .../color-selector/color-selector.controller.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/modules/components/color-selector/color-selector.controller.coffee b/app/modules/components/color-selector/color-selector.controller.coffee index a52ed21b..e183adfe 100644 --- a/app/modules/components/color-selector/color-selector.controller.coffee +++ b/app/modules/components/color-selector/color-selector.controller.coffee @@ -29,7 +29,7 @@ class ColorSelectorController checkIsColorRequired: () -> if !@.isColorRequired - @.colorList = _.dropRight(@.colorList); + @.colorList = _.dropRight(@.colorList) setColor: (color) -> @.color = @.initColor @@ -49,9 +49,9 @@ class ColorSelectorController onKeyDown: (event) -> if event.which == 13 # ENTER - event.stopPropagation() if @.color or not @.isColorRequired @.onSelectDropdownColor(@.color) + event.preventDefault() angular.module('taigaComponents').controller("ColorSelectorCtrl", ColorSelectorController)