diff --git a/pages/component/input/input.test.js b/pages/component/input/input.test.js index a1d7c942125cbda9b933047b02dea9826c589c8a..be9d4e6c8fe5b23f737596e828b7bdb50939abb2 100644 --- a/pages/component/input/input.test.js +++ b/pages/component/input/input.test.js @@ -147,6 +147,22 @@ 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'); + let str = ""; + for(let i = 0;i < 200;i++){ + str += `${i}` + } + await page.setData({ + disableValue: str + }) + let length = (await input.attribute("value")).length + expect(length).toBe(140) + await page.setData({ + disableValue: "" + }) + }) + it("afterAllTestScreenshot", async () => { const image = await program.screenshot({ fullPage: true diff --git a/pages/component/input/input.uvue b/pages/component/input/input.uvue index c5d138f52ea3cfd3565e218a383ff69d33aaefc4..52e85b2d1204875b8d4ba52ace82b0667de218a6 100644 --- a/pages/component/input/input.uvue +++ b/pages/component/input/input.uvue @@ -59,7 +59,7 @@ 设置禁用输入框 - + @@ -265,7 +265,8 @@ inputMaxLengthFocus: false, inputPasswordValue: "", inputFocusKeyBoardChangeValue: true, - holdKeyboard: false + holdKeyboard: false, + disableValue: "" } }, methods: {