-
-
Notifications
You must be signed in to change notification settings - Fork 364
fix(Drawer): missing position variable #6906
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
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR ensures the CSS custom property for the Drawer’s position is only emitted when a valid Position value is provided, preventing empty or invalid style declarations. Class diagram for updated Drawer component style logicclassDiagram
class Drawer {
-string? StyleString
}
Drawer : StyleString uses CssBuilder
class CssBuilder {
+AddClass(string className, bool condition)
+AddStyleFromAttributes(object attributes)
+Build()
}
Drawer --> CssBuilder : builds StyleString using
Flow diagram for Drawer style string construction with position variableflowchart TD
A["Drawer component initialized"] --> B["Check if Position is not null or empty"]
B -- true --> C["Add --bb-drawer-position CSS variable"]
B -- false --> D["Do not add position CSS variable"]
C --> E["Continue building style string"]
D --> E
E --> F["StyleString ready for rendering"]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Pull Request Overview
Fixes a bug in the Drawer component where the position CSS variable was being added unconditionally, potentially causing issues when the Position property is null or empty. The fix adds a null/empty check before applying the CSS class.
- Adds conditional check to prevent adding position CSS variable when Position is null or empty
- Updates version number from beta to release version
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/BootstrapBlazor/Components/Drawer/Drawer.razor.cs | Adds null/empty check for Position property before adding CSS class |
src/BootstrapBlazor/BootstrapBlazor.csproj | Updates version from beta to release |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
||
private string? StyleString => CssBuilder.Default() | ||
.AddClass($"--bb-drawer-position: {Position};") | ||
.AddClass($"--bb-drawer-position: {Position};", !string.IsNullOrEmpty(Position)) |
Copilot
AI
Oct 14, 2025
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.
The AddClass method is being used to add CSS custom properties (CSS variables), but it should be AddStyle instead. CSS custom properties belong in the style attribute, not the class attribute.
Copilot uses AI. Check for mistakes.
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.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6906 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 739 739
Lines 31773 31773
Branches 4467 4467
=========================================
Hits 31773 31773
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Link issues
fixes #6901
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Bug Fixes:
--bb-drawer-position
CSS variable when a valid Position value is provided.