Blazored modal get initialized again when closing an older one #470
-
On the main page of my application there's multiple buttons that allow you to create blazored modal (popover) using different methods that look like this:
Every instruments are created correctly, but whenever I close an instrument, all the other that got created after have their Is there a way to use the @key or something similar that would prevent this problem? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I work with shasastf and we have tried to use update v.7.1.0 where the modification in issue 366 should be. The problem still occurs, if we open 2 Modaled instruments (Of different type) in a row and close the First one before the second one, the second one OnInitialized() is called again, and its position is reset because it is local private variables. Any hints on how to resolve this issue? Thanks for any tip you can provide :) |
Beta Was this translation helpful? Give feedback.
-
I have figured a work around, by using a local object in the function that creates the modal and then pass it as a ref parameter, this keeps the position on refresh and stay alive in the context since the Modal keeps the context alive while open. If we call the function again, it creates a new context and we could have a second instrument of the same type if we wanted (We don't right now, we prevent it, but future project will). |
Beta Was this translation helpful? Give feedback.
I have figured a work around, by using a local object in the function that creates the modal and then pass it as a ref parameter, this keeps the position on refresh and stay alive in the context since the Modal keeps the context alive while open. If we call the function again, it creates a new context and we could have a second instrument of the same type if we wanted (We don't right now, we prevent it, but future project will).