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

(failed) attempt to make the results remain until a new search is run #440

Closed
wants to merge 10 commits into from

Conversation

marianogoldman
Copy link
Contributor

Summary

Checklist

  • Documentation (if necessary)
  • Tests (if necessary)
  • Ready to be merged

@@ -27,6 +27,8 @@ final class SearchPage extends Component

private ?LengthAwarePaginator $results = null;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@faustbrian This property cannot be made public (and hence have LiveWire rehydrate it on each request, at the cost of a larger payload off course). So we have no other option than to run the search again. Which I think it's a waste of time, given we still expect the user to enter other details in other fields before the search makes sense.

@@ -23,15 +23,15 @@

@if($results && $results->count())
<div>
@if ($state['type'] === 'block')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was an attempt to re-render not based on current selection (which is being updated), but on latest search results. Of course it doesn't work, because $results didn't keep state.

Base automatically changed from CU-2h2vay_Defer-property-updates-in-search-component to develop November 4, 2020 01:35
@marianogoldman marianogoldman deleted the search-doesnt-change-until-findit branch November 4, 2020 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants