Skip to content

feat(lxl-web): Prevent lost value and selection when loading supersearch#1564

Open
johanbissemattsson wants to merge 11 commits intodevelopfrom
feat-lxlweb-prevent-lost-focus-when-loading-supersearch
Open

feat(lxl-web): Prevent lost value and selection when loading supersearch#1564
johanbissemattsson wants to merge 11 commits intodevelopfrom
feat-lxlweb-prevent-lost-focus-when-loading-supersearch

Conversation

@johanbissemattsson
Copy link
Copy Markdown
Contributor

@johanbissemattsson johanbissemattsson commented Apr 20, 2026

Description

Solves

When loading the site on slow connections (e.g. on trains) users could start editing the fallback input before the lazy-loaded supersearch component has finished loading. The contents added (as well as the selection) would then be reset when mounting the lazy-loaded component which can be frustrating. This PR solves this by passing along the current value and selection.

Further improvements can later be made where so the selection is placed directly after pills when selecting qualifiers before mount (as this requires parsing the syntax grammer).

The PR also further implements context usage for controlling the component from outside instead of using component binding.

Summary of changes

  • Use searchContext to control SuperSearch from outside
  • Move fallback search input to separate component
  • Pass along current value and selection when mounting SuperSearchWrapper
  • Use same focus styling on collapsed and expanded state

@johanbissemattsson johanbissemattsson requested review from jesperengstrom and olovy and removed request for jesperengstrom April 20, 2026 07:45
@jesperengstrom jesperengstrom self-requested a review April 21, 2026 08:21
Copy link
Copy Markdown
Contributor

@jesperengstrom jesperengstrom left a comment

Choose a reason for hiding this comment

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

Nice! ⭐

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.

2 participants