From 0c534644bc1908fad4e8df5754d3ec224bc7ed7e Mon Sep 17 00:00:00 2001 From: bartes Date: Fri, 18 Nov 2011 20:10:04 +0100 Subject: fix(input): bind inputs to the 'input' event The input event is fired on all non-ie browsers whenever the contents of an input field changes. This means that we now support cut&paste via mouse which was previously unsupported. IE8 and older don't support this events and IE9 has a problematic support for it, so we can't rely solely on this event and drop keydown and change events. --- test/widget/inputSpec.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'test/widget/inputSpec.js') diff --git a/test/widget/inputSpec.js b/test/widget/inputSpec.js index dfbc506a..e8b0a420 100644 --- a/test/widget/inputSpec.js +++ b/test/widget/inputSpec.js @@ -112,7 +112,7 @@ describe('widget: input', function() { describe("input", function() { describe("text", function() { - it('should input-text auto init and handle keydown/change events', function() { + it('should input-text auto init and listen on keydown/change/input events', function() { compile(''); scope.name = 'Adam'; @@ -130,6 +130,13 @@ describe('widget: input', function() { browserTrigger(element, 'change'); defer.flush(); expect(scope.name).toEqual('Kai'); + + if (!(msie<=8)) { + element.val('Lunar'); + browserTrigger(element, 'input'); + defer.flush(); + expect(scope.name).toEqual('Lunar'); + } }); -- cgit v1.2.3