ant-design-vue icon indicating copy to clipboard operation
ant-design-vue copied to clipboard

Using the textarea in the AutoComplete component, Every time the Chinese input method is activated, there are problems with the input.

Open Odin-7 opened this issue 11 months ago • 4 comments

  • [ ] I have searched the issues of this repository and believe that this is not a duplicate.

Version

4.1.0

Environment

Google Chrome (121.0.6167.185)

Reproduction link

https://next.antdv.com/components/auto-complete-cn

Steps to reproduce

In version 4.1.2, there is an issue with input when using the textarea in the AutoComplete component. Every time the Chinese input method is activated, there are problems with the input.

What is expected?

The issue lies in word composition processing during Chinese input.

What is actually happening?

When entering Chinese, the input method progressively forms a complete Chinese character or word phrase through word composition processing. It waits for the user to confirm the input word or character before submitting it to the target element. When typing in English, each keystroke triggers an input event. The difference between these two scenarios requires special handling in the code.

Odin-7 avatar Mar 05 '24 09:03 Odin-7

Uploading 20240305_174302.mp4…

As mentioned above, the issue arises from the word composition processing during Chinese input.

Odin-7 avatar Mar 05 '24 09:03 Odin-7

image

By outputting the value of e.target.composing separately under English and Chinese input methods, it can be confirmed that the issue is indeed caused by the word composition process in Chinese input method. The handleKeyPress event is not being triggered correctly in the Chinese input method state.

Odin-7 avatar Mar 05 '24 10:03 Odin-7

#7391 pr already exists

selicens avatar Mar 05 '24 13:03 selicens

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar May 11 '24 02:05 github-actions[bot]