diff --git a/src/components/form-spinbutton/form-spinbutton.js b/src/components/form-spinbutton/form-spinbutton.js index ec15b92f366..f977550ed05 100644 --- a/src/components/form-spinbutton/form-spinbutton.js +++ b/src/components/form-spinbutton/form-spinbutton.js @@ -366,8 +366,6 @@ export const BFormSpinbutton = /*#__PURE__*/ Vue.extend({ return } this.resetTimers() - // Enable body mouseup event handler - this.setMouseup(true) // Step the counter initially stepper(1) const threshold = this.computedThreshold @@ -393,9 +391,10 @@ export const BFormSpinbutton = /*#__PURE__*/ Vue.extend({ const { type, button } = evt || {} /* istanbul ignore if */ if (type === 'mouseup' && button) { - // we only care about left (main === 0) mouse button click + // Ignore non left button (main === 0) mouse button click return } + evt.preventDefault() this.resetTimers() this.setMouseup(false) // Trigger the change event @@ -437,8 +436,10 @@ export const BFormSpinbutton = /*#__PURE__*/ Vue.extend({ props: { scale: this.hasFocus ? 1.5 : 1.25 }, attrs: { 'aria-hidden': 'true' } }) - const handler = evt => /* istanbul ignore next: until tests written */ { + const handler = evt => { if (!isDisabled && !isReadonly) { + evt.preventDefault() + this.setMouseup(true) this.handleStepRepeat(evt, stepper) } }