Skip to content
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

[HxRadioButtonList][HxCheckboxList] Adds Toogle buttons to Radio and Checkbox lists #879

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

mmonteagudo
Copy link
Contributor

This intent to add the Bootstrap Toogle buttons view for radio and checkbox lists https://getbootstrap.com/docs/5.3/forms/checks-radios/#toggle-buttons

@hakenr
Copy link
Member

hakenr commented Sep 23, 2024

@mmonteagudo Thanks for submitting this PR. I'd like to build on the base you've provided and fine-tune this feature so we can release it to production.

@crdo Could you please take a look and add your review?

@hakenr hakenr mentioned this pull request Sep 23, 2024
@hakenr hakenr linked an issue Sep 23, 2024 that may be closed by this pull request
Comment on lines +152 to +157
if (inputAsToggleEffective != Bootstrap.InputAsToggle.Toggle)
{
builder.OpenElement(100, "div");
// TODO CoreCssClass
builder.AddAttribute(101, "class", CssClassHelper.Combine("form-check", Inline ? "form-check-inline" : null, ItemCssClassImpl, ItemCssClassSelectorImpl?.Invoke(item)));
}
Copy link
Member

Choose a reason for hiding this comment

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

Careful, this ignores ItemCssClass and ItemCssClassSelector for toggle buttons.
We need to decide whether we can make these work somehow, or if the combination with toggle buttons will be unsupported (in which case, we should probably throw an exception in OnParametersSet).

/// <summary>
/// Input as toggle or regular.
/// </summary>
[Parameter] public InputAsToggle? InputAsToggle { get; set; }
Copy link
Member

Choose a reason for hiding this comment

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

The API is up for discussion in the related issue #887.

@hakenr hakenr added the Premium label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Toggle buttons
2 participants