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

SetTitle(string title) not work #565

Open
allrightsreserved opened this issue Mar 4, 2024 · 8 comments
Open

SetTitle(string title) not work #565

allrightsreserved opened this issue Mar 4, 2024 · 8 comments
Labels
Bug Something isn't working Needs: More Information The author needs to provide more information on the issue.

Comments

@allrightsreserved
Copy link

Describe the bug
SetTitle(string title) not work

To Reproduce
Steps to reproduce the behavior:
protected override void OnInitialized() => BlazoredModal.SetTitle("Enter a Message");

,but the title is empty

Expected behavior
the title can be set by OnInitialized()

Screenshots
Screenshot 2024-03-04 230806

Hosting Model (is this issue happening with a certain hosting model?):

  • Blazor Server

Additional context

@allrightsreserved allrightsreserved added Bug Something isn't working Triage Issue needs to be triaged labels Mar 4, 2024
@chrissainty
Copy link
Member

Can you provide a repro project as I can't understand what you are doing based on your description

@chrissainty chrissainty added Needs: More Information The author needs to provide more information on the issue. and removed Triage Issue needs to be triaged labels Mar 14, 2024
@allrightsreserved
Copy link
Author

I just use this downloaded project, then run "Samples">"InteractiveServer"
when I click the button "Show Modal" from "Returning Data" page
1

, the popup shows but without title:
2

In the file "MessageForm.razor" > "protected override void OnInitialized() => BlazoredModal.SetTitle("Enter a Message");"
there are a SetTitle() function but looks not works.

Can you provide a repro project as I can't understand what you are doing based on your description

@PesceJonathan
Copy link

The problem was introduced in this commit since you are preventing any re-rendering of the FocusTrap. The title sits within the FocusTrap, therefore the title itself never gets re-rendered.

The solutions would either to remove the following from focus trap:
image

Or it would be to change it so it would compare the child contents. If the child content is updated, we re-render the component.

Can create a PR with the fix of removing the ShouldRender tonight, but if there is a preference or reducing re-rendering I can make a PR for that instead.

@PesceJonathan
Copy link

Any update on this?

@allrightsreserved
Copy link
Author

Yes, my problem was solved by removing the following code:
image
thank you :)

@heckradr
Copy link

heckradr commented May 2, 2024

Is there a build pipeline for NuGet? Version 7.3.1 there still seems to have the problem.

@PesceJonathan
Copy link

@heckradr No there isn't yet. The PR has still not been reviewed or accepted.

@allrightsreserved The issue shouldn't be closed. You fixed the issue you had in the example project, but the nugget still has the error in it and the project on this repo still has it.

@chrissainty Can you please help us move this forward when you get a chance.

@allrightsreserved
Copy link
Author

@heckradr No there isn't yet. The PR has still not been reviewed or accepted.

@allrightsreserved The issue shouldn't be closed. You fixed the issue you had in the example project, but the nugget still has the error in it and the project on this repo still has it.

@chrissainty Can you please help us move this forward when you get a chance.

reopened

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Needs: More Information The author needs to provide more information on the issue.
Projects
None yet
Development

No branches or pull requests

4 participants