From 70d024cba1497f2a66ac88da852e93a25db1416d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Ba=C5=A1e?= Date: Fri, 6 Nov 2015 08:57:46 +0100 Subject: [PATCH 1/3] Added possibility to add number or number[] to .val() --- jquery/jquery-tests.ts | 2 ++ jquery/jquery.d.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/jquery/jquery-tests.ts b/jquery/jquery-tests.ts index 62cd273f4d..13c568cb33 100644 --- a/jquery/jquery-tests.ts +++ b/jquery/jquery-tests.ts @@ -3128,6 +3128,8 @@ function test_val() { $("#single").val("Single2"); $("#multiple").val(["Multiple2", "Multiple3"]); $("input").val(["check1", "check2", "radio1"]); + $("input").val(1); + $("input").val([1, 2, 3]); } function test_selector() { diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index 8401753e35..9f7a13d89f 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -1365,7 +1365,7 @@ interface JQuery { * * @param value A string of text or an array of strings corresponding to the value of each matched element to set as selected/checked. */ - val(value: string|string[]): JQuery; + val(value: string|string[]|number|number[]): JQuery; /** * Set the value of each element in the set of matched elements. * From 7d29bad1f3915793e3bfdcbfc0720c9cd7f96fe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Ba=C5=A1e?= Date: Fri, 6 Nov 2015 09:03:08 +0100 Subject: [PATCH 2/3] Added possibility to add number or number[] to .val() --- jquery/jquery-tests.ts | 2 ++ jquery/jquery.d.ts | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/jquery/jquery-tests.ts b/jquery/jquery-tests.ts index 62cd273f4d..13c568cb33 100644 --- a/jquery/jquery-tests.ts +++ b/jquery/jquery-tests.ts @@ -3128,6 +3128,8 @@ function test_val() { $("#single").val("Single2"); $("#multiple").val(["Multiple2", "Multiple3"]); $("input").val(["check1", "check2", "radio1"]); + $("input").val(1); + $("input").val([1, 2, 3]); } function test_selector() { diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index 8401753e35..9cf3a58647 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -1363,9 +1363,9 @@ interface JQuery { /** * Set the value of each element in the set of matched elements. * - * @param value A string of text or an array of strings corresponding to the value of each matched element to set as selected/checked. + * @param value A string of text, an array of strings, number or an array of numbers corresponding to the value of each matched element to set as selected/checked. */ - val(value: string|string[]): JQuery; + val(value: string|string[]|number|number[]): JQuery; /** * Set the value of each element in the set of matched elements. * From b13a8c64ffd368b4528f222f404f67b4c7d76cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Ba=C5=A1e?= Date: Wed, 11 Nov 2015 12:54:47 +0100 Subject: [PATCH 3/3] JQuery - removed number[] from .val() --- jquery/jquery-tests.ts | 1 - jquery/jquery.d.ts | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/jquery/jquery-tests.ts b/jquery/jquery-tests.ts index 13c568cb33..27eea1c813 100644 --- a/jquery/jquery-tests.ts +++ b/jquery/jquery-tests.ts @@ -3129,7 +3129,6 @@ function test_val() { $("#multiple").val(["Multiple2", "Multiple3"]); $("input").val(["check1", "check2", "radio1"]); $("input").val(1); - $("input").val([1, 2, 3]); } function test_selector() { diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index 9cf3a58647..29b7697b2a 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -1363,9 +1363,9 @@ interface JQuery { /** * Set the value of each element in the set of matched elements. * - * @param value A string of text, an array of strings, number or an array of numbers corresponding to the value of each matched element to set as selected/checked. + * @param value A string of text, an array of strings or number corresponding to the value of each matched element to set as selected/checked. */ - val(value: string|string[]|number|number[]): JQuery; + val(value: string|string[]|number): JQuery; /** * Set the value of each element in the set of matched elements. *