Blazored / Modal

A powerful and customizable modal implementation for Blazor applications.
https://blazored.github.io/Modal/
MIT License
764 stars 184 forks source link

Remove should render always being false for the focus trap #573

Closed PesceJonathan closed 1 week ago

PesceJonathan commented 3 months ago

Fix for the following issue.

Essentially, set title stopped working because the title is used as part of the child content for the FocusTrap component, where the FocusTrap is set to never re-render. This essentially means that its children never re-render, leading to the title never being set. You can see examples and more in the issue.

The fix just allows for the focus trap to re-render.

heckradr commented 1 week ago

@chrissainty it would be great if you could take a look at this PR. It's just a small change but it has a big impact.

chrissainty commented 1 week ago

@PesceJonathan @heckradr This can't just be removed. It was added due to the enormous quantity of re-renders that can happen in different use cases. This was causing perf issues for people.

I'm happy to look at other solutions that can fix the problems for everyone. I'm going to close this for now as it's not the answer right now.