The Wayback Machine - https://web.archive.org/web/20201106091011/https://github.com/dotnet/AspNetCore.Docs/pull/20236
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

Blazor FocusAsync coverage #20236

Merged
merged 17 commits into from Oct 22, 2020
Merged

Blazor FocusAsync coverage #20236

merged 17 commits into from Oct 22, 2020

Conversation

@guardrex
Copy link
Collaborator

@guardrex guardrex commented Oct 20, 2020

Fixes #20232
Fixes #20195

guardrex added 3 commits Oct 20, 2020
@guardrex guardrex requested a review from captainsafia Oct 20, 2020
guardrex added 6 commits Oct 21, 2020
@guardrex
Copy link
Collaborator Author

@guardrex guardrex commented Oct 21, 2020

@captainsafia I was trying not to change Javier's lingo too much, but I agree with you. It's much better to just rewrite it to avoid the versioning altogether. Also, it was 😵 half-baked 😵 ... I didn't have all of the focus event-based example converted over to a click-based event example, which is necessary now that Blazor has a nice way to focus things without custom JS interop.

Also, I think prefixing objects/members with my isn't so hot. I'm still playing with a general naming approach to avoid my, but perhaps example as a prefix is good (e.g., myInput 👉 exampleInput, mybutton 👉 exampleButton) ... it's on this PR to see how it composes. If you have a better idea, I'm all 👂👂👂.

guardrex added 6 commits Oct 21, 2020
@guardrex
Copy link
Collaborator Author

@guardrex guardrex commented Oct 21, 2020

Also @captainsafia ... one more little thing that we can put on here for issue #20195.

@mrlife inquired on the "guarantee" in the reasoning for not being able to pass element references between components. I think what that "guarantee" means is that the element reference doesn't exist until the component is rendered ... therefore ... that late in rendering the component ... nothing can be passed as a parameter. Thus (along with being a struct), the guidance is to use a callback.

I change that text here on the last commit to try and fix up the "guarantee" lingo to explain it that way. See if that update makes sense to u.

@mrlife, please review that last commit.

ADDITIONAL: I'm going to make one more little update to the struct remark. See if that works, too.

Copy link
Contributor

@captainsafia captainsafia left a comment

Looking pretty good!

Tangentially: do we have docs on our updated IJSObjectReference stuff?

@guardrex
Copy link
Collaborator Author

@guardrex guardrex commented Oct 21, 2020

@captainsafia

do we have docs on our updated IJSObjectReference stuff?

Yes ... it's in the 5.0 version of the doc at ...

https://docs.microsoft.com/en-us/aspnet/core/blazor/call-javascript-from-dotnet?view=aspnetcore-5.0#blazor-javascript-isolation-and-object-references

... also mentioned here (and Pranav said this is enough here, i.e., we don't need an example for this mention) ...

https://docs.microsoft.com/en-us/aspnet/core/blazor/webassembly-performance-best-practices?view=aspnetcore-5.0#consider-making-synchronous-calls

Co-authored-by: Safia Abdalla <safia@microsoft.com>
@guardrex
Copy link
Collaborator Author

@guardrex guardrex commented Oct 21, 2020

🙈😄

await exampleInput.FocusAsync();

"FocusAsync" ....... Async!! .... await .... Geebers McScreebers! 😄

One of these days, I'll learn how to do async. Not today, of course! ... but one day. 😁

@guardrex
Copy link
Collaborator Author

@guardrex guardrex commented Oct 22, 2020

@captainsafia ... I committed ur updates. I think we're good here. This won't go live until later today/tonight, so we have time to sneak another PR in if needed.

@guardrex guardrex merged commit 453b2e9 into master Oct 22, 2020
2 checks passed
2 checks passed
OpenPublishing.Build Validation status: passed
Details
license/cla All CLA requirements met.
Details
@guardrex guardrex deleted the guardrex-patch-1 branch Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.