Skip to content

Commit

Permalink
fix(Input): fallback to using tap event (#2946)
Browse files Browse the repository at this point in the history
* fix(Input): fallback to using tap event

* test: update snapshots
  • Loading branch information
anlyyao committed Jul 3, 2024
1 parent 5e39c4b commit 7cbffd6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/input/__test__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ exports[`input props : clearable && label && suffix 1`] = `
/>
<wx-view
class="t-input__wrap--clearable-icon"
bind:touchstart="clearInput"
bind:tap="clearInput"
>
<t-icon
class=""
Expand Down
2 changes: 1 addition & 1 deletion src/input/__test__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ describe('input', () => {
comp.attach(document.createElement('parent-wrapper'));

const clearable = comp.querySelector('.base >>> .t-input__wrap--clearable-icon');
clearable.dispatchEvent('touchstart');
clearable.dispatchEvent('tap');
await simulate.sleep(0);
expect(handleClear.mock.calls[0][0].detail).toStrictEqual({});
});
Expand Down
2 changes: 1 addition & 1 deletion src/input/input.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<view
wx:if="{{_clearIcon && value.length > 0 && showClearIcon}}"
class="{{classPrefix}}__wrap--clearable-icon"
bind:touchstart="clearInput"
bind:tap="clearInput"
>
<template
is="icon"
Expand Down

0 comments on commit 7cbffd6

Please sign in to comment.