Skip to content

Commit

Permalink
enhance(input-number): enhance step button (#2668)
Browse files Browse the repository at this point in the history
  • Loading branch information
flsion authored Aug 25, 2023
1 parent ca5e41c commit 9decb50
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/web-vue/components/input-number/input-number.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { getKeyDownHandler, KEYBOARD_KEY } from '../_utils/keyboard';

type StepMethods = 'minus' | 'plus';

const FIRST_DELAY = 800;
const SPEED = 150;

NP.enableBoundaryChecking(false);
Expand Down Expand Up @@ -400,7 +401,7 @@ export default defineComponent({
if (needRepeat) {
repeatTimer = window.setTimeout(
() => (event.target as HTMLElement).dispatchEvent(event),
SPEED
repeatTimer ? SPEED : FIRST_DELAY
);
}
};
Expand Down

0 comments on commit 9decb50

Please sign in to comment.