Commit Graph

2 Commits

Author SHA1 Message Date
dd0a6bd188 FIX: Bookmark search input can't be cleared with backspace with ?q= present (#31919)
Meta:
https://meta.discourse.org/t/cant-erase-the-bookmark-search-input/357861/4

> When we fill in the bookmark search input and send the request, then
we can’t delete the input’s content.

After removing the last character, the `searchTerm` getter is called. At
this point, `_searchTerm` is empty.
However, `this._searchTerm || this.q` will treat the empty string as
_falsy_, and the `q` value is displayed instead.
It makes it impossible to clear the input.

To fix this, we check specifically on the initial state of
`_searchTerm,` which is _undefined_, to include an empty string as a
valid value.

Note: because of `@computed`, the issue is not triggered when the
content is selected and deleted.
2025-03-21 09:50:05 +08:00
6f91014d64 FIX: correctly filter user bookmarks (#28612)
We were not updating `searchTerm` when changing the input which was making us always send an empty q parameter.

This commit is also adding tests for:
- initial url with q param
- filtering the bookmarks through the input
2024-08-28 15:39:07 -04:00