@easyops-cn/docusaurus-search-local 0.55.0 → 0.55.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [0.55.1](https://github.com/easyops-cn/docusaurus-search-local/compare/v0.55.0...v0.55.1) (2026-02-28)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * limit caret-to-end fix to small screens (max-width: 576px) only ([d1d6e08](https://github.com/easyops-cn/docusaurus-search-local/commit/d1d6e08d21e02b80b78bf7cf3c73493cd4fdde01))
11
+ * move caret to end of input when re-opening search bar on mobile ([47692df](https://github.com/easyops-cn/docusaurus-search-local/commit/47692df69ecb1fd067d7636a199b693ee71e57f1))
12
+ * move search caret to end on focus, small screens only ([69c24f1](https://github.com/easyops-cn/docusaurus-search-local/commit/69c24f15a3c1b32dd55bb0aaf6c0acb294abf26a))
13
+
5
14
  ## [0.55.0](https://github.com/easyops-cn/docusaurus-search-local/compare/v0.54.1...v0.55.0) (2026-02-13)
6
15
 
7
16
 
@@ -268,6 +268,11 @@ export default function SearchBar({ handleSearchBarToggle, }) {
268
268
  search.current?.autocomplete.open();
269
269
  }
270
270
  input.focus();
271
+ // On small screens the input is collapsed by default; after expanding via
272
+ // focus, move the caret to the end so backspace works as expected.
273
+ if (window.matchMedia("(max-width: 576px)").matches) {
274
+ input.setSelectionRange(input.value.length, input.value.length);
275
+ }
271
276
  }
272
277
  }, [hidden, searchContext, versionUrl, baseUrl, history]);
273
278
  useEffect(() => {
@@ -304,6 +309,17 @@ export default function SearchBar({ handleSearchBarToggle, }) {
304
309
  loadIndex();
305
310
  setFocused(true);
306
311
  handleSearchBarToggle?.(true);
312
+ // On small screens the input is collapsed by default; after expanding via
313
+ // focus, move the caret to the end so backspace works as expected.
314
+ // On large screens we leave the native caret behaviour untouched.
315
+ if (window.matchMedia("(max-width: 576px)").matches) {
316
+ const input = searchBarRef.current;
317
+ if (input) {
318
+ setTimeout(() => {
319
+ input.setSelectionRange(input.value.length, input.value.length);
320
+ }, 0);
321
+ }
322
+ }
307
323
  }, [handleSearchBarToggle, loadIndex]);
308
324
  const onInputBlur = useCallback(() => {
309
325
  setFocused(false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyops-cn/docusaurus-search-local",
3
- "version": "0.55.0",
3
+ "version": "0.55.1",
4
4
  "description": "An offline/local search plugin for Docusaurus v3",
5
5
  "repository": {
6
6
  "type": "git",