forked from code-squad/javascript-food
-
Notifications
You must be signed in to change notification settings - Fork 0
devLog[08017] Event Composition
Chany edited this page Aug 20, 2018
·
7 revisions
- 한글에서 이벤트 2번 불리는 상황 해결 및
- 키 up& down에 반응해서 activeIdx랑 -> activeIdx에 된 text값 을 input value 로 매칭하도록 하기
- mouseover에도 반응해서 active되도록 설정 or hover에 반응
HighLight되는 부분이 엄청 느렸다 넘어가는 속도가 ... 일단 눈에 보이는 부분을 처음에 Selector범위를 주지 않아서
this.keyWordList를 추가해주니 눈에 띄게 그래도 좋아졌다.
그리고 중첩된 li선택자를 빼고 data속성만으로 찾게 해주었다.
조금 더 좋아졌다. 근데 그래도 아직 이슈가 될 정도다 바로 바로 반응이 안 된다 _=''' 망했다 얼른 찾아보자
디버깅 중 반응이 느린 것보다 up&down 아예 한 번은 반응이 전체가 안 된다 _=''''이 부분을 해결해주어야 된다 ;;;
알고보니 그냥 2번 중에 한 번만 실행되는 거였다. 속도가 문제가 아니라 ;;;
qs(`li[data-id="${firstIdx}"]`)
qs(`li[data-id="${firstIdx}"]`, this.keyWordList))
qs(`[data-id="${firstIdx}"]`, this.keyWordList))
이 부분 해결한 방식 조합중이고 그 다음 true-false일 때 2번 실행이 된다. 왜 인지는 잘 모르겠다;;;; 그래서 이전 상태값을 가지고 일단 해결하였지만 좋은 방법인지 모르겠다. 다시 공부해보고 적용해야 겠다.
handleKeyup(e){
const {isComposing, keyCode } = e
if(this.isUpDownKey(keyCode)){
if(!isComposing&&(!this.beforeComposition)) this.handleUpDownKeyPressed(e.keyCode);
this.beforeComposition = isComposing;
}
else {
this.beforeComposition = isComposing;
return this.setAjax(e)
}
}