Skip to content
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

[#1163] Select - filterable 에서 한글 입력이 바로 반영되지 않는 문제 #1163

Merged
merged 1 commit into from
May 18, 2022
Merged
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
5 changes: 4 additions & 1 deletion src/components/select/Select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,11 @@
>
<input
v-if="filterable"
v-model="filterTextRef"
type="text"
class="ev-input-query"
:placeholder="searchPlaceholder"
:value="filterTextRef"
@input="changeFilterText"
/>
<div
ref="itemWrapper"
Expand Down Expand Up @@ -242,6 +243,7 @@ export default {
filteredItems,
clickSelectInput,
clickOutsideDropbox,
changeFilterText,
changeDropboxPosition,
clickItem,
selectedItemClass,
Expand All @@ -266,6 +268,7 @@ export default {
filteredItems,
clickSelectInput,
clickOutsideDropbox,
changeFilterText,
changeDropboxPosition,
clickItem,
selectedItemClass,
Expand Down
8 changes: 8 additions & 0 deletions src/components/select/uses.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ export const useDropdown = (param) => {
return props.items.filter(v => v.name.toUpperCase().includes(trimText.toUpperCase())) || [];
});

/**
* filterable 에서 text input 이벤트 핸들러
*/
const changeFilterText = (e) => {
filterTextRef.value = e?.target?.value;
};

/**
* dropdown box 위치 변경하는 메소드
*/
Expand Down Expand Up @@ -255,6 +262,7 @@ export const useDropdown = (param) => {
filteredItems,
clickSelectInput,
clickOutsideDropbox,
changeFilterText,
changeDropboxPosition,
clickItem,
selectedItemClass,
Expand Down