Skip to content

Conversation

@tbl0605
Copy link
Contributor

@tbl0605 tbl0605 commented Sep 22, 2025

Hello,
Would it be possible to make the useScrollLock() function available/visible outside of the bootstrap-vue-next library, please?

I've implemented my own full-screen overlays (as loading indicators) and I'm using createSharedComposable(useScrollLock) from the @vueuse/core library to disable page scrolling when the full-screen overlays are visible.
Since the bootstrap-vue-next library uses the same technique when modals are visible, it would be nice for me to be able to use a single instance of createSharedComposable(useScrollLock) throughout the entire Vue application.

Also note that since my apps have 2 instances of scroll lock (because I can't access the one in bootstrap-vue-next), I need to check if the one in bootstrap-vue-next is active (before it conflicts with mine) by testing document.body.style.overflow === 'hidden'. Using a single instance of scroll lock would eliminate the need for this kind of hack.

PR checklist

What kind of change does this PR introduce? (check at least one)

  • Bugfix 🐛 - fix(...)
  • Feature - feat(...)
  • ARIA accessibility - fix(...)
  • Documentation update - docs(...)
  • Other (please describe)

The PR fulfills these requirements:

  • Pull request title and all commits follow the Conventional Commits convention or has an override in this pull request body This is very important, as the CHANGELOG is 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 denied

Summary by CodeRabbit

  • New Features
    • Added a new composable: useScrollLock, enabling apps to lock/unlock page scrolling when needed.
    • The composable is now part of the public API and available through the documented external path for composables.

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@coderabbitai
Copy link

coderabbitai bot commented Sep 22, 2025

Walkthrough

Added a new public composable export useScrollLock and registered its external path mapping. No other exports or mappings were modified.

Changes

Cohort / File(s) Summary
Composable exports
packages/bootstrap-vue-next/src/composables/index.ts
Added export: useScrollLock from './useScrollLock'.
Options type mappings
packages/bootstrap-vue-next/src/types/BootstrapVueOptions.ts
Updated composablesWithExternalPath to include useScrollLock: '/composables/useScrollLock'.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A hop, a lock, a gentle scroll,
I twitch my ears—now in control.
New paths mapped neat, exports in line,
Carrot-code compiled just fine.
Thump-thump! I ship with glee—
Scrolls stay put, as they should be. 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title "feat: export useScrollLock() to make it available to the entire application" accurately and concisely summarizes the primary change (exporting useScrollLock for application-wide use) and follows the Conventional Commits "feat:" prefix, making it clear and relevant to the changes in the patch.
Description Check ✅ Passed The PR description provides a clear, concrete motivation for the change, explains how the exported composable will be used (including the createSharedComposable use case), and includes the repository checklist with the Conventional Commits item marked, matching the template's required information; the optional "Small replication" section is not present but is not required.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0963e44 and 894f6c4.

📒 Files selected for processing (2)
  • packages/bootstrap-vue-next/src/composables/index.ts (1 hunks)
  • packages/bootstrap-vue-next/src/types/BootstrapVueOptions.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-12T14:46:49.416Z
Learnt from: CR
PR: bootstrap-vue-next/bootstrap-vue-next#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-12T14:46:49.416Z
Learning: Applies to packages/bootstrap-vue-next/src/components/index.ts : When adding a new component, update packages/bootstrap-vue-next/src/components/index.ts to export it

Applied to files:

  • packages/bootstrap-vue-next/src/composables/index.ts
  • packages/bootstrap-vue-next/src/types/BootstrapVueOptions.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: test-lint
  • GitHub Check: build
🔇 Additional comments (2)
packages/bootstrap-vue-next/src/types/BootstrapVueOptions.ts (1)

143-143: External-path mapping added — consistent with pattern (verified)

  • Mapping present: packages/bootstrap-vue-next/src/types/BootstrapVueOptions.ts:143 — useScrollLock: '/composables/useScrollLock',
  • Export present: packages/bootstrap-vue-next/src/composables/index.ts — export {useScrollLock} from './useScrollLock'
  • Implementation present: packages/bootstrap-vue-next/src/composables/useScrollLock.ts (referenced by packages/bootstrap-vue-next/src/composables/useSafeScrollLock.ts)
  • No docs/deep-link found for useScrollLock in docs/ or site/; add a docs page/deep-link and record this new public API in the changelog (or track as a follow-up).
packages/bootstrap-vue-next/src/composables/index.ts (1)

4-4: Named export present; confirm SSR-safety of external imports

useScrollLock is exported as a named export (packages/bootstrap-vue-next/src/composables/useScrollLock.ts:3) and this file has no top-level document/window usage; verify that the imported _useScrollLock and createSharedComposable from @vueuse/core do not access window/document at module-eval time.

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 22, 2025

bsvn-vite-ts

npm i https://pkg.pr.new/bootstrap-vue-next/bootstrap-vue-next@2854
npm i https://pkg.pr.new/bootstrap-vue-next/bootstrap-vue-next/@bootstrap-vue-next/nuxt@2854

commit: 894f6c4

@VividLemon VividLemon merged commit 6685308 into bootstrap-vue-next:main Sep 29, 2025
5 checks passed
xvaara added a commit to xvaara/bootstrap-vue-next that referenced this pull request Oct 11, 2025
* upstream/main:
  chore: release main (bootstrap-vue-next#2868)
  fix(useModalOrchestrator): circular dependency (bootstrap-vue-next#2874)
  docs(BModal): Parity pass (bootstrap-vue-next#2866)
  docs: Enable directly loading examples into StackBlitz (bootstrap-vue-next#2869)
  fix(BApp): wrap our test app in BApp in main.ts to enable easy verification of useModal, etc. (bootstrap-vue-next#2865)
  export useScrollLock() (bootstrap-vue-next#2854)
  chore: release main (bootstrap-vue-next#2858)
  fix(BToggle): stop looking for missing targets after directive is unmounted (bootstrap-vue-next#2857)
  chore: release main (bootstrap-vue-next#2851)
  Fix modal transition delays by making TransitionGroup name conditional (bootstrap-vue-next#2845)
  chore: release main (bootstrap-vue-next#2842)
  fix(BTable): events being wrongly stopped when sent from elements inside TRs (bootstrap-vue-next#2841)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants