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

docs(TextField): fix the CustomColors demo #2090

Merged
merged 2 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -165,25 +165,25 @@

static List<string> animals = new() { "Dog", "Cat", "Rabbit", "Turtle", "Snake" };

MForm form;
MForm? form;
bool terms;
bool conditions;
bool snackbar;
string content = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur sodales ligula in libero. Sed dignissim lacinia nunc.";

Model model = new();

bool FormIsValid => form != null && form.EditContext.IsModified() && form.EditContext.Validate();
bool FormIsValid => form?.Value is true;

void ResetForm()
{
form.Reset();
form?.Reset();
}

void Submit()
{
snackbar = true;
form.Reset();
form?.Reset();
}

public class Model
Expand Down
9 changes: 7 additions & 2 deletions src/Masa.Blazor.Docs.ApiGenerator/ApiGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -348,12 +348,17 @@ private static string GetTypeText(INamedTypeSymbol? type)

return null;

static string? GetClassTypeText(INamedTypeSymbol? type)
static string? GetClassTypeText(INamedTypeSymbol type)
{
var properties = type.GetMembers().Where(m => m.Kind == SymbolKind.Property)
.Select(m =>
{
var type = (m as IPropertySymbol).Type;
var type = (m as IPropertySymbol)?.Type;
if (type == null)
{
return (m.Name, Type: string.Empty);
}

if (type.TypeKind == TypeKind.TypeParameter)
{
return (m.Name, Type: type.Name);
Expand Down
Loading