Skip to content

Add missing code to example 10 of BitButton demo (#12289)#12290

Merged
msynk merged 1 commit into
bitfoundation:developfrom
zahra-yousefi:12289-button-demo-missing-codes
Apr 27, 2026
Merged

Add missing code to example 10 of BitButton demo (#12289)#12290
msynk merged 1 commit into
bitfoundation:developfrom
zahra-yousefi:12289-button-demo-missing-codes

Conversation

@zahra-yousefi
Copy link
Copy Markdown
Member

@zahra-yousefi zahra-yousefi commented Apr 27, 2026

closes #12289

Summary by CodeRabbit

  • New Features
    • Added scroll-to-element functionality for buttons, enabling users to navigate directly to specific sections of the page when clicking designated button components.

@msynk msynk requested a review from Copilot April 27, 2026 18:25
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: eaa0d5fa-0359-4712-be74-1cecfe74f0e0

📥 Commits

Reviewing files that changed from the base of the PR and between 25329de and bbe50c2.

📒 Files selected for processing (1)
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/Button/BitButtonDemo.razor.samples.cs

Walkthrough

Adds JavaScript interop support to the BitButton demo component by injecting IJSRuntime and implementing an async ScrollToFloat method that enables the example 10 button to scroll to a targeted element.

Changes

Cohort / File(s) Summary
BitButton Demo Sample Code
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Buttons/Button/BitButtonDemo.razor.samples.cs
Adds IJSRuntime injection and implements the ScrollToFloat async method that was previously missing from the example 10 sample code, enabling JS interop for scroll-to-element functionality.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Hoppy hop, the samples now are whole,
A button click that plays its proper role,
JavaScript whispers from the interop shore,
Example ten dances like never before!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding missing code to example 10 of the BitButton demo, which aligns with the PR's primary objective of restoring the ScrollToFloat method.
Linked Issues check ✅ Passed The PR successfully addresses the objective from issue #12289 by adding the missing ScrollToFloat method and related JS interop code (IJSRuntime injection) to the BitButton demo example 10.
Out of Scope Changes check ✅ Passed All changes are directly related to restoring the missing ScrollToFloat method in example 10; no out-of-scope modifications were introduced.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the BitButton demo’s Example 10 C# sample snippet to include the missing ScrollToFloat method (and required IJSRuntime injection) so the displayed code matches the working demo implementation (closes #12289).

Changes:

  • Added [Inject] IJSRuntime field to Example 10’s C# snippet.
  • Added ScrollToFloat method to the snippet to support the OnClick="ScrollToFloat" usage.

@msynk msynk merged commit 0648971 into bitfoundation:develop Apr 27, 2026
7 checks passed
@zahra-yousefi zahra-yousefi deleted the 12289-button-demo-missing-codes branch April 27, 2026 19:13
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.

Missing code parts in the sample code of the example 10 of the BitButton demo page

3 participants