nhn / tui.date-picker

Component that selects specific date.
https://nhn.github.io/tui.date-picker/latest/
MIT License
94 stars 30 forks source link

`tui-ico-date` className 을 클릭할 때 에러 발생 #95

Open jeong-sik opened 2 years ago

jeong-sik commented 2 years ago

Describe the bug

tui-ico-date className 을 가진 친구가 svg Element 일 경우 util.js 에서 className 을 올바르게 찾지 못해 에러가 납니다.

To Reproduce

Steps to reproduce the behavior:

  1. tui-ico-date className 을 가진 SVG 엘리먼트를 추가
  2. 해당 SVG 엘리먼트를 클릭
  3. 에러가 발생
<div className={wrapperClassName} onClick=handleClick>
    <div className={Cn.\"<:>"("tui-datepicker-input tui-datetime-input tui-has-focus", "")}>
      <input
        type_="text"
        // ref={ReactDOM.Ref.domRef(inputRef)}
        onFocus=handleFocus
        defaultValue=date
        onKeyDown={e => e->ReactEvents.stopSyntheticDefaultEvent}
        id="tui-date-picker-target"
        ariaLabel="Date-Time"
      />
      <Svg.Calendar className="tui-ico-date" height="28px" width="28px" fill="" />
    </div>
    <div
      id="tui-date-picker-container"
      className={Cn.\"<:>"(selectorClassName, style(. [marginTop(px(-1))]))}
    />
</div>

Expected behavior

A clear and concise description of what you expected to happen. 위 코드일 경우 input의 icon 을 클릭할 경우 className 에 직접 접근하다가 오류를 뱉는 경우가 있습니다.

Screenshots

If applicable, add screenshots to help explain your problem.

image

image

Desktop (please complete the following information):

Additional context

classList 를 쓰고싶긴 한데 IE8 에 없군요

HarleyWilkins commented 9 months ago

I am also running into this issue when using a button with an icon.