Skip to content

Resolved anomalous behavior of input and keydown events when typing in Korean #163 #164

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## v2.4.2 (April 6, 2023)

### autocomplete-core

- Added condition statement `event.isComposing` to method `handleKeyDown`. The reason is the abnormal behavior of the input event when typing Korean. (SoonMin, [@Ssoon-m](https://github.com/Ssoon-m))

### autocomplete-vue

- Added a `prevValue` and changed the handleInput method. The reason is the abnormal behavior of the input event when typing Korean.
(SoonMin, [@Ssoon-m](https://github.com/Ssoon-m))

## v2.4.1 (January 13, 2023)

### autocomplete-core
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.4.1",
"version": "2.4.2",
"packages": [
"packages/*"
],
Expand Down
2 changes: 1 addition & 1 deletion packages/autocomplete-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@trevoreyre/autocomplete-js",
"version": "2.4.1",
"version": "2.4.2",
"description": "Simple autocomplete component in vanilla JS and Vue",
"main": "dist/autocomplete.cjs.js",
"module": "dist/autocomplete.esm.js",
Expand Down
9 changes: 7 additions & 2 deletions packages/autocomplete-vue/Autocomplete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export default {
return {
core,
value: this.defaultValue,
prevValue: '',
resultListId: uniqueId(`${this.baseClass}-result-list-`),
results: [],
selectedIndex: -1,
Expand Down Expand Up @@ -238,8 +239,12 @@ export default {
},

handleInput(event) {
this.value = event.target.value
this.core.handleInput(event)
const currentValue = event.target.value
if (currentValue !== this.prevValue) {
this.value = currentValue
this.prevValue = currentValue
this.core.handleInput(event)
}
},

handleSubmit(selectedResult) {
Expand Down
2 changes: 1 addition & 1 deletion packages/autocomplete-vue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@trevoreyre/autocomplete-vue",
"version": "2.4.1",
"version": "2.4.2",
"description": "Simple autocomplete component in vanilla JS and Vue",
"main": "dist/autocomplete.cjs.js",
"module": "dist/autocomplete.esm.js",
Expand Down
1 change: 1 addition & 0 deletions packages/autocomplete/AutocompleteCore.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class AutocompleteCore {
}

handleKeyDown = event => {
if (event.isComposing) return
const { key } = event

switch (key) {
Expand Down
2 changes: 1 addition & 1 deletion packages/autocomplete/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@trevoreyre/autocomplete",
"version": "2.4.1",
"version": "2.4.2",
"description": "Simple autocomplete component in vanilla JS and Vue",
"main": "dist/autocomplete.cjs.js",
"module": "dist/autocomplete.esm.js",
Expand Down