Skip to content

Commit

Permalink
fix: compatible with mobile click events (#334)
Browse files Browse the repository at this point in the history
  • Loading branch information
mengxiong10 committed Nov 17, 2021
1 parent 384dd7b commit 1a45263
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/date-picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,10 +476,18 @@ export default {
);
const calendarIcon = this.type === 'time' ? <IconTime /> : <IconCalendar />;
return (
<div class={`${prefixClass}-input-wrapper`} onMousedown={this.openPopup}>
<div
class={`${prefixClass}-input-wrapper`}
onMousedown={this.openPopup}
onTouchstart={this.openPopup}
>
{input}
{this.showClearIcon ? (
<i class={`${prefixClass}-icon-clear`} onMousedown={this.handleClear}>
<i
class={`${prefixClass}-icon-clear`}
onMousedown={this.handleClear}
onTouchstart={this.handleClear}
>
{this.renderSlot('icon-clear', <IconClose />)}
</i>
) : null}
Expand Down

0 comments on commit 1a45263

Please sign in to comment.