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

Change the getTarget function to return composedPath[0] to support web components #53

Open
lotstar87 opened this issue Aug 25, 2020 · 0 comments

Comments

@lotstar87
Copy link

Version

2.3.2

Development Environment

MacOS 10.15.6
Chrome 84.0.4147.135

Current Behavior

toast-ui color-picker를 web components로 만들어서 사용할 때 아래와 같은 문제가 발생.

palette 영역 클릭 시, getTarget 함수가 e.target을 반환하는데, 이때 target이 palette 영역이 아닌 web component가 반환되어, click에 대한 이벤트핸들러에서 오류가 발생
(lotstar87/twc-color-picker#1)

// domEvent/getTarget.js
function getTarget(e) {
  return e.target || e.srcElement; 
}

Expected Behavior

getTarget 함수가 e.composedPath()[0]을 반환하도록 변경

// domEvent/getTarget.js
function getTarget(e) {
  return e.composedPath()[0];
}
@lotstar87 lotstar87 changed the title Changed the getTarget function to return composedPath[0] to support web components Change the getTarget function to return composedPath[0] to support web components Aug 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant