Skip to content

Commit

Permalink
Fix element-ref-across-components example (#463)
Browse files Browse the repository at this point in the history
  • Loading branch information
guardrex authored Jan 28, 2025
1 parent ba02586 commit dbca3f4
Show file tree
Hide file tree
Showing 25 changed files with 53 additions and 21 deletions.
2 changes: 0 additions & 2 deletions 3.1/BlazorSample_Server/Pages/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@
<h1>Hello, world!</h1>

Welcome to your new app.

<SurveyPrompt Title="How is Blazor working for you?" />
2 changes: 1 addition & 1 deletion 3.1/BlazorSample_Server/Shared/SurveyPrompt.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void OnError(Exception error)
public void OnNext(ElementReference value)
{
JS?.InvokeAsync<object>(
"setElementClass", [ value, "red" ]);
"setElementClass", new object[] { value, "red" });
}

public void Dispose()
Expand Down
4 changes: 4 additions & 0 deletions 3.1/BlazorSample_Server/wwwroot/css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ app {
background-color: rgba(255, 255, 255, 0.1);
}

.red {
color: red
}

.valid.modified:not([type=checkbox]) {
outline: 1px solid #26b050;
}
Expand Down
2 changes: 0 additions & 2 deletions 3.1/BlazorSample_WebAssembly/Pages/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@
<h1>Hello, world!</h1>

Welcome to your new app.

<SurveyPrompt Title="How is Blazor working for you?" />
2 changes: 0 additions & 2 deletions 5.0/BlazorSample_Server/Pages/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@
<h1>Hello, world!</h1>

Welcome to your new app.

<SurveyPrompt Title="How is Blazor working for you?" />
2 changes: 0 additions & 2 deletions 5.0/BlazorSample_WebAssembly/Pages/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@
<h1>Hello, world!</h1>

Welcome to your new app.

<SurveyPrompt Title="How is Blazor working for you?" />
2 changes: 0 additions & 2 deletions 6.0/BlazorSample_Server/Pages/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@
<h1>Hello, world!</h1>

Welcome to your new app.

<SurveyPrompt Title="How is Blazor working for you?" />
2 changes: 0 additions & 2 deletions 6.0/BlazorSample_WebAssembly/Pages/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@
<h1>Hello, world!</h1>

Welcome to your new app.

<SurveyPrompt Title="How is Blazor working for you?" />
2 changes: 0 additions & 2 deletions 7.0/BlazorSample_Server/Pages/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@
<h1>Hello, world!</h1>

Welcome to your new app.

<SurveyPrompt Title="How is Blazor working for you?" />
2 changes: 0 additions & 2 deletions 7.0/BlazorSample_WebAssembly/Pages/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@
<h1>Hello, world!</h1>

Welcome to your new app.

<SurveyPrompt Title="How is Blazor working for you?" />
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protected override void OnParametersSet()
public void OnError(Exception error) => subscription = null;

public void OnNext(ElementReference value) =>
_ = (JS?.InvokeAsync<object>("setElementClass", [value, "red"]));
_ = (JS?.InvokeAsync<object>("setElementClass", [ value, "red" ]));

public void Dispose()
{
Expand Down
2 changes: 1 addition & 1 deletion 8.0/BlazorSample_WebAssembly/Shared/SurveyPrompt.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protected override void OnParametersSet()
public void OnError(Exception error) => subscription = null;

public void OnNext(ElementReference value) =>
JS?.InvokeAsync<object>("setElementClass", [value, "red"]);
JS?.InvokeAsync<object>("setElementClass", [ value, "red" ]);

public void Dispose()
{
Expand Down
4 changes: 4 additions & 0 deletions 8.0/BlazorSample_WebAssembly/wwwroot/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,7 @@ a, .btn-link {
code {
color: #c02d76;
}

.red {
color: red;
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ code {
color: #c02d76;
}

.red {
color: red;
}

label {
font-weight: bold;
color: darkblue;
Expand Down
4 changes: 4 additions & 0 deletions 8.0/BlazorWebAssemblyEntraGroupsAndRoles/wwwroot/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,7 @@ a, .btn-link {
code {
color: #c02d76;
}

.red {
color: red;
}
4 changes: 4 additions & 0 deletions 8.0/BlazorWebAssemblyScopesLogger/wwwroot/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,7 @@ a, .btn-link {
code {
color: #c02d76;
}

.red {
color: red;
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ code {
color: #c02d76;
}

.red {
color: red;
}

label {
font-weight: bold;
color: darkblue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protected override void OnParametersSet()
public void OnError(Exception error) => subscription = null;

public void OnNext(ElementReference value) =>
_ = (JS?.InvokeAsync<object>("setElementClass", [value, "red"]));
_ = (JS?.InvokeAsync<object>("setElementClass", [ value, "red" ]));

public void Dispose()
{
Expand Down
2 changes: 1 addition & 1 deletion 9.0/BlazorSample_WebAssembly/Shared/SurveyPrompt.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protected override void OnParametersSet()
public void OnError(Exception error) => subscription = null;

public void OnNext(ElementReference value) =>
JS?.InvokeAsync<object>("setElementClass", [value, "red"]);
JS?.InvokeAsync<object>("setElementClass", [ value, "red" ]);

public void Dispose()
{
Expand Down
4 changes: 4 additions & 0 deletions 9.0/BlazorSample_WebAssembly/wwwroot/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ code {
color: #c02d76;
}

.red {
color: red;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
color: var(--bs-secondary-color);
text-align: end;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ code {
color: #c02d76;
}

.red {
color: red;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
color: var(--bs-secondary-color);
text-align: end;
Expand Down
4 changes: 4 additions & 0 deletions 9.0/BlazorWebAssemblyEntraGroupsAndRoles/wwwroot/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ code {
color: #c02d76;
}

.red {
color: red;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
color: var(--bs-secondary-color);
text-align: end;
Expand Down
4 changes: 4 additions & 0 deletions 9.0/BlazorWebAssemblyScopesLogger/wwwroot/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ code {
color: #c02d76;
}

.red {
color: red;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
color: var(--bs-secondary-color);
text-align: end;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ code {
color: #c02d76;
}

.red {
color: red;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
color: var(--bs-secondary-color);
text-align: end;
Expand Down
4 changes: 4 additions & 0 deletions BlazorWebAssemblyXrefGenerator/wwwroot/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ code {
color: #c02d76;
}

.red {
color: red;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
color: var(--bs-secondary-color);
text-align: end;
Expand Down

0 comments on commit dbca3f4

Please sign in to comment.