From c0643fd437597edeec15173b7fa64741c0e7fa26 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 24 May 2021 16:38:35 +0800 Subject: [PATCH] refactor(vc-time-picker): input should be readonly #4084 (#4111) --- .../__snapshots__/index.test.js.snap | 102 +++++++++--------- .../__snapshots__/index.test.js.snap | 2 +- components/vc-time-picker/TimePicker.jsx | 3 +- 3 files changed, 53 insertions(+), 54 deletions(-) diff --git a/components/locale-provider/__tests__/__snapshots__/index.test.js.snap b/components/locale-provider/__tests__/__snapshots__/index.test.js.snap index c3f219519..0a9a3a5fd 100644 --- a/components/locale-provider/__tests__/__snapshots__/index.test.js.snap +++ b/components/locale-provider/__tests__/__snapshots__/index.test.js.snap @@ -609,7 +609,7 @@ exports[`Locale Provider should display the text as ar 1`] = `
- + ~ @@ -1151,7 +1151,7 @@ exports[`Locale Provider should display the text as bg 1`] = `
- + ~ @@ -1693,7 +1693,7 @@ exports[`Locale Provider should display the text as ca 1`] = `
- + ~ @@ -2235,7 +2235,7 @@ exports[`Locale Provider should display the text as cs 1`] = `
- + ~ @@ -2777,7 +2777,7 @@ exports[`Locale Provider should display the text as da 1`] = `
- + ~ @@ -3319,7 +3319,7 @@ exports[`Locale Provider should display the text as de 1`] = `
- + ~ @@ -3861,7 +3861,7 @@ exports[`Locale Provider should display the text as el 1`] = `
- + ~ @@ -4403,7 +4403,7 @@ exports[`Locale Provider should display the text as en 1`] = `
- + ~ @@ -4945,7 +4945,7 @@ exports[`Locale Provider should display the text as en-gb 1`] = `
- + ~ @@ -5487,7 +5487,7 @@ exports[`Locale Provider should display the text as es 1`] = `
- + ~ @@ -6029,7 +6029,7 @@ exports[`Locale Provider should display the text as et 1`] = `
- + ~ @@ -6571,7 +6571,7 @@ exports[`Locale Provider should display the text as fa 1`] = `
- + ~ @@ -7113,7 +7113,7 @@ exports[`Locale Provider should display the text as fi 1`] = `
- + ~ @@ -7655,7 +7655,7 @@ exports[`Locale Provider should display the text as fr 1`] = `
- + ~ @@ -8197,7 +8197,7 @@ exports[`Locale Provider should display the text as fr 2`] = `
- + ~ @@ -8739,7 +8739,7 @@ exports[`Locale Provider should display the text as he 1`] = `
- + ~ @@ -9281,7 +9281,7 @@ exports[`Locale Provider should display the text as hi 1`] = `
- + ~ @@ -9823,7 +9823,7 @@ exports[`Locale Provider should display the text as hr 1`] = `
- + ~ @@ -10365,7 +10365,7 @@ exports[`Locale Provider should display the text as hu 1`] = `
- + ~ @@ -10907,7 +10907,7 @@ exports[`Locale Provider should display the text as hy 1`] = `
- + ~ @@ -11449,7 +11449,7 @@ exports[`Locale Provider should display the text as id 1`] = `
- + ~ @@ -11991,7 +11991,7 @@ exports[`Locale Provider should display the text as is 1`] = `
- + ~ @@ -12533,7 +12533,7 @@ exports[`Locale Provider should display the text as it 1`] = `
- + ~ @@ -13075,7 +13075,7 @@ exports[`Locale Provider should display the text as ja 1`] = `
- + ~ @@ -13617,7 +13617,7 @@ exports[`Locale Provider should display the text as kn 1`] = `
- + ~ @@ -14159,7 +14159,7 @@ exports[`Locale Provider should display the text as ko 1`] = `
- + ~ @@ -14701,7 +14701,7 @@ exports[`Locale Provider should display the text as ku-iq 1`] = `
- + ~ @@ -15243,7 +15243,7 @@ exports[`Locale Provider should display the text as lv 1`] = `
- + ~ @@ -15785,7 +15785,7 @@ exports[`Locale Provider should display the text as mk 1`] = `
- + ~ @@ -16327,7 +16327,7 @@ exports[`Locale Provider should display the text as mn-mn 1`] = `
- + ~ @@ -16869,7 +16869,7 @@ exports[`Locale Provider should display the text as ms-my 1`] = `
- + ~ @@ -17411,7 +17411,7 @@ exports[`Locale Provider should display the text as nb 1`] = `
- + ~ @@ -17953,7 +17953,7 @@ exports[`Locale Provider should display the text as ne-np 1`] = `
- + ~ @@ -18495,7 +18495,7 @@ exports[`Locale Provider should display the text as nl 1`] = `
- + ~ @@ -19037,7 +19037,7 @@ exports[`Locale Provider should display the text as nl-be 1`] = `
- + ~ @@ -19579,7 +19579,7 @@ exports[`Locale Provider should display the text as pl 1`] = `
- + ~ @@ -20121,7 +20121,7 @@ exports[`Locale Provider should display the text as pt 1`] = `
- + ~ @@ -20663,7 +20663,7 @@ exports[`Locale Provider should display the text as pt-br 1`] = `
- + ~ @@ -21205,7 +21205,7 @@ exports[`Locale Provider should display the text as ro 1`] = `
- + ~ @@ -21747,7 +21747,7 @@ exports[`Locale Provider should display the text as ru 1`] = `
- + ~ @@ -22289,7 +22289,7 @@ exports[`Locale Provider should display the text as sk 1`] = `
- + ~ @@ -22831,7 +22831,7 @@ exports[`Locale Provider should display the text as sl 1`] = `
- + ~ @@ -23373,7 +23373,7 @@ exports[`Locale Provider should display the text as sr 1`] = `
- + ~ @@ -23915,7 +23915,7 @@ exports[`Locale Provider should display the text as sv 1`] = `
- + ~ @@ -24457,7 +24457,7 @@ exports[`Locale Provider should display the text as ta 1`] = `
- + ~ @@ -24999,7 +24999,7 @@ exports[`Locale Provider should display the text as th 1`] = `
- + ~ @@ -25541,7 +25541,7 @@ exports[`Locale Provider should display the text as tr 1`] = `
- + ~ @@ -26083,7 +26083,7 @@ exports[`Locale Provider should display the text as uk 1`] = `
- + ~ @@ -26625,7 +26625,7 @@ exports[`Locale Provider should display the text as vi 1`] = `
- + ~ @@ -27167,7 +27167,7 @@ exports[`Locale Provider should display the text as zh-cn 1`] = `
- + ~ @@ -27709,7 +27709,7 @@ exports[`Locale Provider should display the text as zh-tw 1`] = `
- + ~ diff --git a/components/time-picker/__tests__/__snapshots__/index.test.js.snap b/components/time-picker/__tests__/__snapshots__/index.test.js.snap index fabce4694..ce3fc35bf 100644 --- a/components/time-picker/__tests__/__snapshots__/index.test.js.snap +++ b/components/time-picker/__tests__/__snapshots__/index.test.js.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`TimePicker not render clean icon when allowClear is false 1`] = ` - + `; diff --git a/components/vc-time-picker/TimePicker.jsx b/components/vc-time-picker/TimePicker.jsx index 503b252e1..8f16b52be 100644 --- a/components/vc-time-picker/TimePicker.jsx +++ b/components/vc-time-picker/TimePicker.jsx @@ -341,7 +341,6 @@ export default defineComponent({ name, autocomplete, autofocus, - inputReadOnly, sOpen, sValue, onFocus, @@ -381,7 +380,7 @@ export default defineComponent({ onFocus={onFocus} onBlur={onBlur} autofocus={autofocus} - readonly={!!inputReadOnly} + readonly id={id} /> {inputIcon || }