SamProf / MatBlazor

Material Design components for Blazor and Razor Components
http://www.matblazor.com
MIT License
2.84k stars 384 forks source link

some of the icons are mapped wrong #902

Closed drma-tech closed 2 years ago

drma-tech commented 3 years ago

image

I was loading a combo with the available icons and I noticed that some are bringing broken values, including duplicates.

enginexon commented 3 years ago

Could you create example on https://blazorfiddle.com/ ?

drma-tech commented 3 years ago

@enginexon on the icons page itself, it already shows this.

image

enginexon commented 3 years ago

@SamProf I confirm it, bug can be found in the device section on the icon's demo page device section. https://www.matblazor.com/Icon

enginexon commented 3 years ago

@drma-dev I could suggest a workaround until it will be fixed

static MatIconDataIcon[] GetValidMatIconDataIcons()
{
    var excludeIconIds = new HashSet<string>(new string[]
    {
        "play_circle_filled_white",
        "battery_20",
        "battery_30",
        "battery_40",
        "battery_50",
        "battery_60",
        "battery_70",
        "battery_80",
        "battery_90",
        "battery_charging_20",
        "battery_charging_30",
        "battery_charging_40",
        "battery_charging_50",
        "battery_charging_60",
        "battery_charging_70",
        "battery_charging_80",
        "battery_charging_90",
        "signal_cellular_1_bar",
        "signal_cellular_2_bar",
        "signal_cellular_3_bar",
        "signal_cellular_connected_no_internet_1_bar",
        "signal_cellular_connected_no_internet_2_bar",
        "signal_cellular_connected_no_internet_3_bar",
        "signal_wifi_1_bar",
        "signal_wifi_2_bar",
        "signal_wifi_3_bar",
        "signal_wifi_1_bar_lock",
        "signal_wifi_2_bar_lock",
        "signal_wifi_3_bar_lock",
        "",
    }, StringComparer.InvariantCultureIgnoreCase);

    return MatIconCategories.Data
        .SelectMany(x => x.Icons)
        .Where(x => !excludeIconIds.Contains(x.Id))
        .ToArray();
}