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

Allow Component Parameters to override BlazoriseOptions :: Example Icon #4897

Closed
sks-ttaylor opened this issue Jul 27, 2023 · 2 comments
Closed
Assignees
Labels
Type: Bug 🐞 Something isn't working
Milestone

Comments

@sks-ttaylor
Copy link
Contributor

Describe the bug
I am unable to override BlazoriseOptions.IconSize at the Icon component level.

To Reproduce

In Program.cs ::
services.AddBlazorise(options => {
options.IconStyle = IconStyle.Solid;
options.IconSize = IconSize.Small;
});

In Razor::

Expected behavior
I expect to be able to override any BlazoriseOptions at the Component level.

Screenshots

Additional context
Icon.razor.cs

CURRENT
protected IconSize GetIconSize() => Options.IconSize ?? IconSize ?? Blazorise.IconSize.Default;
protected IconStyle GetIconStyle() => Options.IconStyle ?? IconStyle ?? Blazorise.IconStyle.Solid;

RECOMMEDED
protected IconSize GetIconSize() => IconSize ?? Options.IconSize ?? Blazorise.IconSize.Default;
protected IconStyle GetIconStyle() => IconStyle ?? Options.IconStyle ?? Blazorise.IconStyle.Solid;

This change should be made for any component that implements a BlazoriseOptions setting.

@sks-ttaylor sks-ttaylor added the Type: Bug 🐞 Something isn't working label Jul 27, 2023
@David-Moreira
Copy link
Contributor

Seems like an oversight indeed. Other places seem to be correct.
@stsrki any specific reason why options could take precedence over the more specific definition in the component?

As a side note, this does not seem to be used anywhere:
image

@stsrki
Copy link
Collaborator

stsrki commented Jul 28, 2023

It seems like an oversight, indeed. We will fix it.

As a side note, this does not seem to be used anywhere:
image

TBH, I don't remember about that feature. Probably a long-time API that was used at some point.

@stsrki stsrki added this to the 1.2 support milestone Jul 28, 2023
This was referenced Jul 28, 2023
@stsrki stsrki closed this as completed Jul 28, 2023
@stsrki stsrki added this to Support Aug 3, 2024
@stsrki stsrki moved this to ✔ Done in Support Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 🐞 Something isn't working
Projects
Archived in project
Development

No branches or pull requests

3 participants