Skip to content

Commit efcd4bb

Browse files
feat: ✨ Input、Textarea增加ignoreCompositionEvent属性 (#592)
Closes: #574
1 parent 2f12ac6 commit efcd4bb

File tree

6 files changed

+18
-7
lines changed

6 files changed

+18
-7
lines changed

docs/component/input.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ function handleChange(event) {
172172
| rules | 表单验证规则,结合`wd-form`组件使用 | `FormItemRule []` | - | `[]` | - |
173173
| clearTrigger | 显示清除图标的时机,always 表示输入框不为空时展示,focus 表示输入框聚焦且不为空时展示 | `InputClearTrigger` | `focus` / `always` | `always` | 1.3.7 |
174174
| focusWhenClear | 是否在点击清除按钮时聚焦输入框 | boolean | - | true | 1.3.7 |
175-
175+
| ignoreCompositionEvent | 是否忽略组件内对文本合成系统事件的处理。为 false 时将触发 compositionstart、compositionend、compositionupdate 事件,且在文本合成期间会触发 input 事件。 | boolean | - | true | $LOWEST_VERSION$|
176176

177177

178178
### FormItemRule 数据结构

docs/component/textarea.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ const value = ref<string>('')
162162
| rules | 表单验证规则 | `FormItemRule []` | - | `[]` | - |
163163
| clearTrigger | 显示清除图标的时机,always 表示输入框不为空时展示,focus 表示输入框聚焦且不为空时展示 | `InputClearTrigger` | `focus` / `always` | `always` | 1.3.7 |
164164
| focusWhenClear | 是否在点击清除按钮时聚焦输入框 | boolean | - | true | 1.3.7 |
165+
| ignoreCompositionEvent | 是否忽略组件内对文本合成系统事件的处理。为 false 时将触发 compositionstart、compositionend、compositionupdate 事件,且在文本合成期间会触发 input 事件。 | boolean | - | true | $LOWEST_VERSION$|
165166

166167
### FormItemRule 数据结构
167168

src/uni_modules/wot-design-uni/components/wd-input/types.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,18 @@ export const inputProps = {
162162
* 显示清除图标的时机,always 表示输入框不为空时展示,focus 表示输入框聚焦且不为空时展示
163163
* 类型: "focus" | "always"
164164
* 默认值: "always"
165-
* 最低版本: $LOWEST_VERSION$
166165
*/
167166
clearTrigger: makeStringProp<InputClearTrigger>('always'),
168167
/**
169168
* 是否在点击清除按钮时聚焦输入框
170169
* 类型: boolean
171170
* 默认值: true
172-
* 最低版本: $LOWEST_VERSION$
173171
*/
174-
focusWhenClear: makeBooleanProp(true)
172+
focusWhenClear: makeBooleanProp(true),
173+
/**
174+
* 是否忽略组件内对文本合成系统事件的处理。为 false 时将触发 compositionstart、compositionend、compositionupdate 事件,且在文本合成期间会触发 input 事件
175+
* 类型: boolean
176+
* 默认值: true
177+
*/
178+
ignoreCompositionEvent: makeBooleanProp(true)
175179
}

src/uni_modules/wot-design-uni/components/wd-input/wd-input.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
:hold-keyboard="holdKeyboard"
4343
:always-embed="alwaysEmbed"
4444
:placeholder-class="inputPlaceholderClass"
45+
:ignoreCompositionEvent="ignoreCompositionEvent"
4546
@input="handleInput"
4647
@focus="handleFocus"
4748
@blur="handleBlur"

src/uni_modules/wot-design-uni/components/wd-textarea/types.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,16 +275,20 @@ export const textareaProps = {
275275
* 显示清除图标的时机,always 表示输入框不为空时展示,focus 表示输入框聚焦且不为空时展示
276276
* 类型: "focus" | "always"
277277
* 默认值: "always"
278-
* 最低版本: $LOWEST_VERSION$
279278
*/
280279
clearTrigger: makeStringProp<InputClearTrigger>('always'),
281280
/**
282281
* 是否在点击清除按钮时聚焦输入框
283282
* 类型: boolean
284283
* 默认值: true
285-
* 最低版本: $LOWEST_VERSION$
286284
*/
287-
focusWhenClear: makeBooleanProp(true)
285+
focusWhenClear: makeBooleanProp(true),
286+
/**
287+
* 是否忽略组件内对文本合成系统事件的处理。为 false 时将触发 compositionstart、compositionend、compositionupdate 事件,且在文本合成期间会触发 input 事件
288+
* 类型: boolean
289+
* 默认值: true
290+
*/
291+
ignoreCompositionEvent: makeBooleanProp(true)
288292
}
289293

290294
export type TextareaProps = ExtractPropTypes<typeof textareaProps>

src/uni_modules/wot-design-uni/components/wd-textarea/wd-textarea.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
:confirm-type="confirmType"
3737
:confirm-hold="confirmHold"
3838
:disable-default-padding="disableDefaultPadding"
39+
:ignoreCompositionEvent="ignoreCompositionEvent"
3940
@input="handleInput"
4041
@focus="handleFocus"
4142
@blur="handleBlur"

0 commit comments

Comments
 (0)