-
-
Notifications
You must be signed in to change notification settings - Fork 173
feat(BFormInput): implement no-wheel prop to disable mousewheel events #2903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(BFormInput): implement no-wheel prop to disable mousewheel events #2903
Conversation
|
|
WalkthroughThe pull request removes the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (3 warnings, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
💤 Files with no reviewable changes (1)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this may be a feature that was only useful to bootstrap-vue. Upon reviewing this code, it appears that one could just as easily achieve the same output by just doing
<BFormInput @wheel.prevent /> and wouldn't need our intervention as a prop anyways. If that works, perhaps that prop would better be left unimplemented and mentioned in the migration guide
I do appreciate the effort. @TudorGR , if the code I suggested for BFormInput is correct, would we be better off just making this a note in the documentation? It is more natural "vue" code
1bbaa3f to
d97fba6
Compare
|
I updated PR based on the feedback. Instead of implementing a custom |
|
Thanks |
* upstream/main: (28 commits) fix(BToggle)! Remove redundant attribute cleanup & update docs for accessibility attributes on show/hide components (bootstrap-vue-next#2918) chore: release main (bootstrap-vue-next#2912) fix: allow custom component props in orchestrator create methods with type safety (bootstrap-vue-next#2922) fix(BModal): prevent focus trap error when no tabbable elements exist (bootstrap-vue-next#2864) Update package description for clarity (bootstrap-vue-next#2917) Update project description for clarity and detail test: add event emission tests for BTable and BTableLite (bootstrap-vue-next#2915) fix(BTableLite): Use primary key to persist row-details state when items change (bootstrap-vue-next#2871) chore: release main (bootstrap-vue-next#2896) feat(BTable): add configurable debouncing ci: Add publint to the build process (bootstrap-vue-next#2909) docs(Offcanvas): Parity pass (bootstrap-vue-next#2900) fix(directives): Robustness fixes for directives (bootstrap-vue-next#2906) docs(BFormInput): document @wheel.prevent for disabling mousewheel events (bootstrap-vue-next#2903) fix(typings): Fix paths to `*.d.mts` files (bootstrap-vue-next#2907) feat: add name and form props to BFormRating for form submission (bootstrap-vue-next#2895) docs: refactor docs to avoid duplication and boilerplate code (bootstrap-vue-next#2891) docs(BToast): Parity (bootstrap-vue-next#2887) docs(BModal): fix attribute to hide footer (bootstrap-vue-next#2888) docs(BPlaceholder): Parity pass (bootstrap-vue-next#2886) ...
Implements the no-wheel prop for BFormInput component to disable the browser's default behavior of incrementing/decrementing numeric input values when scrolling the mousewheel over a focused input.
This addresses issue #2901 and provides feature parity with bootstrap-vue.
Changes:
Closes #2901
Describe the PR
This PR implements the missing
no-wheelprop for theBFormInputcomponent, which was previously marked as "Not Yet Implemented" in the documentation.When
no-wheelis set totrue, the component prevents the browser's default mousewheel behavior on numeric-like inputs (e.g.,type="number"). This prevents accidental value changes when users scroll over a focused numeric input field.The implementation is:
false, maintaining existing behaviorpreventDefault()when enabledSmall replication
Usage example:
<BFormInput type="number" no-wheel />Before this PR: Scrolling the mousewheel over a focused numeric input would increment/decrement the value (browser default behavior).
After this PR: With
no-wheelprop set, scrolling the mousewheel over a focused numeric input has no effect on the value.PR checklist
What kind of change does this PR introduce? (check at least one)
fix(...)feat(...)fix(...)docs(...)The PR fulfills these requirements:
CHANGELOGis generated from these messages, and determines the next version type. Pull requests that do not follow conventional commits or do not have an override will be deniedSummary by CodeRabbit
Breaking Changes
noWheelprop from form input components. Use Vue's native@wheel.preventmodifier instead to disable mousewheel increment/decrement behavior on numeric inputs.Documentation
@wheel.preventmodifier, including code examples.