primefaces / primevue

Next Generation Vue UI Component Library
https://primevue.org
MIT License
10.75k stars 1.24k forks source link

KeyFilter: KeyFilter validation does not work correctly with IME (Combinatorial Input) #6724

Open jongwoo328 opened 2 weeks ago

jongwoo328 commented 2 weeks ago

Describe the bug

Validation does not work when entering KeyFilter in Korean on mac. The behavior suggests that this is probably the same for other combinatorial languages (like Chinese, Japanese, etc.). Need to fix KeyFilter so that it validates well for combinatorial languages.

Reproducer

https://stackblitz.com/edit/primevue-4-vite-issue-template-x5b2bh?file=src%2FApp.vue

PrimeVue version

4.2.1

Vue version

3.x

Language

ALL

Build / Runtime

Nuxt

Browser(s)

No response

Steps to reproduce the behavior

  1. you need a KeyFilter component (if you have a regular expression set that prevents you from entering Korean, it doesn't matter if it's preset or you specify the regular expression yourself)
  2. Enter the characters using the Korean keyboard, such as "안녕" (which means "Hi" in Korean). (If you are using a MAC, you can add additional keyboard input languages in the system settings.)
  3. Text different from the specified regular expression is entered.

https://github.com/user-attachments/assets/6652d619-af36-4a32-9c2f-f9fc4772b1e7

Expected behavior

Input that can't pass validation shouldn't be displayed when typing in Korean, just as it is when typing in the English alphabet.

jongwoo328 commented 2 weeks ago

When I looked at the source code, I noticed that the value validation is being done in the keypress eventListener (named onKeyDown), but the keypress event is not fired when using IME.