Skip to content

Commit 1a45263

Browse files
committed
fix: compatible with mobile click events (#334)
1 parent 384dd7b commit 1a45263

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/date-picker.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,10 +476,18 @@ export default {
476476
);
477477
const calendarIcon = this.type === 'time' ? <IconTime /> : <IconCalendar />;
478478
return (
479-
<div class={`${prefixClass}-input-wrapper`} onMousedown={this.openPopup}>
479+
<div
480+
class={`${prefixClass}-input-wrapper`}
481+
onMousedown={this.openPopup}
482+
onTouchstart={this.openPopup}
483+
>
480484
{input}
481485
{this.showClearIcon ? (
482-
<i class={`${prefixClass}-icon-clear`} onMousedown={this.handleClear}>
486+
<i
487+
class={`${prefixClass}-icon-clear`}
488+
onMousedown={this.handleClear}
489+
onTouchstart={this.handleClear}
490+
>
483491
{this.renderSlot('icon-clear', <IconClose />)}
484492
</i>
485493
) : null}

0 commit comments

Comments
 (0)