Skip to content

Conversation

@BorisGerretzen
Copy link
Owner

Closes #9.

Fixes Disabled parameter not working.

Copilot AI review requested due to automatic review settings November 7, 2025 20:57
Copy link

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

This pull request adds a Disabled parameter to the SimpleMultiselect component to prevent user interaction when the component is disabled. The implementation includes proper state handling to close the dropdown when disabled and prevent toggling actions.

Key changes:

  • Added the disabled HTML attribute to the dropdown button when the Disabled parameter is true
  • Implemented logic to close the dropdown when the component becomes disabled
  • Added a guard in the toggle method to prevent opening when disabled

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
SimpleMultiselect.razor Added disabled attribute to button and logic to close dropdown when disabled
DisabledTests.cs Comprehensive test coverage for disabled functionality scenarios
StylingTests.cs Moved styling-related tests to dedicated file
SimpleMultiselectTests.cs Refactored to use BaseTest and removed moved tests
BaseTest.cs Created base test class with shared setup and helper methods
TestValueItem.cs Extracted test model to separate file
TestReferenceItem.cs Extracted test model to separate file
EqualityTests.cs Moved equality-related tests to dedicated file
DisabledDropdown.razor Added demo page for disabled functionality
NavMenu.razor Added navigation link to the disabled dropdown demo

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bind-SelectedOptions="_selectedItems"/>
</div>
<div class="col-4">
<button class="btn btn-primary" @onclick="() => _isDisabled = !_isDisabled">
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

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

Extra space in '_isDisabled =' - should be single space. Change _isDisabled = to _isDisabled =.

Copilot uses AI. Check for mistakes.
@code {
private bool _isDisabled;

private HashSet<string> _selectedItems = [];
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

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

Field '_selectedItems' can be 'readonly'.

Suggested change
private HashSet<string> _selectedItems = [];
private readonly HashSet<string> _selectedItems = [];

Copilot uses AI. Check for mistakes.
@BorisGerretzen BorisGerretzen merged commit 65ef00b into master Nov 7, 2025
2 checks passed
@BorisGerretzen BorisGerretzen deleted the bugfix/disabled branch November 7, 2025 21:32
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.

Disabling Multiselect

2 participants