# Bulk actions in search results: Checkboxes vanish as new content loads

**URL:** https://meta.discourse.org/t/bulk-actions-in-search-results-checkboxes-vanish-as-new-content-loads/111235
**Category:** Bug
**Tags:** bulk-actions
**Created:** [11.Март.2019 02:29:31 UTC](https://meta.discourse.org/t/bulk-actions-in-search-results-checkboxes-vanish-as-new-content-loads/111235 "2019-03-11T02:29:31Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![southpaw](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/southpaw/32/79352_2.png) [@southpaw](https://meta.discourse.org/u/southpaw)
#### Post date: [11.Март.2019 02:29:32 UTC](https://meta.discourse.org/t/bulk-actions-in-search-results-checkboxes-vanish-as-new-content-loads/111235/1 "2019-03-11T02:29:32Z")

</div>

When I try to take bulk actions on search results, the checkboxes vanish every time I hit the bottom of the page and new topics are loaded.

Steps to reproduce:

1. Perform a search that will return more than 50 results.

2. Click the ![image](https://global.discourse-cdn.com/meta/original/3X/0/5/05aa98dcf4a7baffdc459522a59da508583bf468.png) button to select individual topics.

3. Scroll down to the bottom of the search results so that additional topics load.

4. Observe that the checkboxes vanish, requiring you to start the selection task anew.

By contrast, when taking bulk action on a topic list in a Category, the checkboxes are preserved as new content is loaded at the bottom of the page.

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [11.Март.2019 05:56:30 UTC](https://meta.discourse.org/t/bulk-actions-in-search-results-checkboxes-vanish-as-new-content-loads/111235/3 "2019-03-11T05:56:30Z")

</div>

Can repro on [2.3.0.beta3 +115](https://github.com/discourse/discourse/compare/41f09ee29c44424901054a7dbe0bf8c0a9b86742...tests-passed)

---

<div class="post-metadata">

### Author: ![venarius](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/venarius/32/133142_2.png) [@venarius](https://meta.discourse.org/u/venarius)
#### Post date: [11.Март.2019 07:31:49 UTC](https://meta.discourse.org/t/bulk-actions-in-search-results-checkboxes-vanish-as-new-content-loads/111235/4 "2019-03-11T07:31:49Z")

</div>

Has probably something to do with the `loadMore()` function in the `full-page-search.js.es6` controller calling `_search()`, in which there is `this.set("bulkSelectEnabled", false);`

It should probably keep its state when page is greater than 1.

Would love to do a PR!

Edit: PR is open 🙂

[https://github.com/discourse/discourse/pull/7139](https://github.com/discourse/discourse/pull/7139)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [11.Март.2019 08:11:35 UTC](https://meta.discourse.org/t/bulk-actions-in-search-results-checkboxes-vanish-as-new-content-loads/111235/5 "2019-03-11T08:11:35Z")

</div>

> [@southpaw](#):
>
> try to take bulk actions on search results

This is kind of an unusual scenario. You need to take action on more than 50 search results at once?

---

<div class="post-metadata">

### Author: ![southpaw](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/southpaw/32/79352_2.png) [@southpaw](https://meta.discourse.org/u/southpaw)
#### Post date: [11.Март.2019 12:16:30 UTC](https://meta.discourse.org/t/bulk-actions-in-search-results-checkboxes-vanish-as-new-content-loads/111235/6 "2019-03-11T12:16:30Z")

</div>

> [@codinghorror](#):
>
> This is kind of an unusual scenario. You need to take action on more than 50 search results at once?

Yes. I wouldn’t have stumbled upon the issue had I not needed to take action on a large number of search results.

I don’t need to do it frequently, but when I do need it, it would be nice if it worked the same way as the bulk actions in the Category list.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [12.Март.2019 01:54:26 UTC](https://meta.discourse.org/t/bulk-actions-in-search-results-checkboxes-vanish-as-new-content-loads/111235/7 "2019-03-12T01:54:26Z")

</div>

Cool, thanks for the fix @venarius I just deployed it to your site @southpaw and it should be live in 20 mins.

Its not 100% perfect but we no longer losing state which was the big bug here.

---

<div class="post-metadata">

### Author: ![southpaw](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/southpaw/32/79352_2.png) [@southpaw](https://meta.discourse.org/u/southpaw)
#### Post date: [12.Март.2019 02:40:31 UTC](https://meta.discourse.org/t/bulk-actions-in-search-results-checkboxes-vanish-as-new-content-loads/111235/8 "2019-03-12T02:40:31Z")

</div>

Thanks for the quick action to get this solved!

> [@sam](#):
>
> Its not 100% perfect

I’m not sure what 100% perfect would look like, but this fix is good!

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [12.Март.2019 03:26:46 UTC](https://meta.discourse.org/t/bulk-actions-in-search-results-checkboxes-vanish-as-new-content-loads/111235/9 "2019-03-12T03:26:46Z")

</div>

> [@southpaw](#):
>
> I’m not sure what 100% perfect would look like

I was being a bit vague… we don’t plan to gold plate this, however… if we were to gold plate it…

1. User clicks “select all”
2. We detect not everything is loaded, we display something like this (in a modal)

 ![image](https://global.discourse-cdn.com/meta/original/3X/9/e/9e3250f8eedd3213a3373f08d6499dc66301cbe6.jpeg)

I think its totally fair for me to explain this thing, but yeah we will not be taking pull requests on this rare functionality quite yet.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [13.Март.2019 07:00:01 UTC](https://meta.discourse.org/t/bulk-actions-in-search-results-checkboxes-vanish-as-new-content-loads/111235/10 "2019-03-13T07:00:01Z")

</div>

This topic was automatically closed after 29 hours. New replies are no longer allowed.
