From 3216a75949a0bc66efb2934a23a883995b9fe832 Mon Sep 17 00:00:00 2001 From: taohebin Date: Mon, 11 Mar 2024 12:40:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9input=20maxlength?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=8C=96=E6=B5=8B=E8=AF=95=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/component/input/input.test.js | 10 +++++----- pages/component/input/input.uvue | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pages/component/input/input.test.js b/pages/component/input/input.test.js index be9d4e6c..181d8b37 100644 --- a/pages/component/input/input.test.js +++ b/pages/component/input/input.test.js @@ -147,19 +147,19 @@ describe('component-native-input', () => { expect(await (await page.$('#uni-input-cursor-color')).attribute("cursor-color")).toBe("red") }) - it("maxlength default", async () => { - const input = await page.$('#uni-input-disable'); + it("maxlength", async () => { + const input = await page.$('#uni-input-maxlength'); let str = ""; for(let i = 0;i < 200;i++){ str += `${i}` } await page.setData({ - disableValue: str + inputMaxLengthValue: str }) let length = (await input.attribute("value")).length - expect(length).toBe(140) + expect(length).toBe(10) await page.setData({ - disableValue: "" + inputMaxLengthValue: "" }) }) diff --git a/pages/component/input/input.uvue b/pages/component/input/input.uvue index 52e85b2d..0d34c5f4 100644 --- a/pages/component/input/input.uvue +++ b/pages/component/input/input.uvue @@ -59,7 +59,7 @@ 设置禁用输入框 - + @@ -266,7 +266,6 @@ inputPasswordValue: "", inputFocusKeyBoardChangeValue: true, holdKeyboard: false, - disableValue: "" } }, methods: { -- GitLab