You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this example there's one form which enables the user to search some arbitrary data.
Then the results load and they are rendered inside another form, for the purposes of enabling interaction with each result (but still using forms and static SSR).
At the moment, when you click a button in the search results, the form is submitted, but I was hoping the search results would remain present on the screen.
As it is, they disappear as soon as you try to interact with any of the items.
OK, now I've written that out and thought about it I realise the answer is presumably to execute the search in OnInitialized to ensure the results are still rendered on the page following the form post.
I guess my thought was that data-enhance might preserve the existing DOM but it makes sense that it wouldn't (I think :))
Uh oh!
There was an error while loading. Please reload this page.
ref: #49340 (comment)
I tried implementing a similar approach to this, with some data being loaded via an external API and ran into some unexpected behaviour.
Here's a minimal repro:
https://github.com/jonhilt/BlazorNet8Testing/blob/master/RTMTest/Components/Pages/Home.razor
In this example there's one form which enables the user to search some arbitrary data.
Then the results load and they are rendered inside another form, for the purposes of enabling interaction with each result (but still using forms and static SSR).
At the moment, when you click a button in the search results, the form is submitted, but I was hoping the search results would remain present on the screen.
As it is, they disappear as soon as you try to interact with any of the items.
(this is with data-enhance enabled).
dotnet: 8.0.100-rtm.23503.6
Originally posted by @jonhilt in #49340 (comment)
The text was updated successfully, but these errors were encountered: