Skip to content

Resolve the router URL against the page before a search - #77

Open
s3rgiosan wants to merge 1 commit into
humanmade:mainfrom
s3rgiosan:76/search-after-filter
Open

s3rgiosan wants to merge 1 commit into
humanmade:mainfrom
s3rgiosan:76/search-after-filter

Conversation

@s3rgiosan

Copy link
Copy Markdown

Fixes #76.

Changes

  1. JS: updateURL() in src/taxonomy/view.js resolves the core/router URL against window.location.href. A filter navigates to its option's value, which is a relative URL, and the router keeps that value in state.url. Before this change, new URL() threw Invalid URL, and a search after a filter did nothing.
  2. Test: tests/e2e/search-filter.spec.js checks a filter, then a search, in the same loop. The search keeps the filter and narrows the results. The test fails without the fix.

Testing

  • npx playwright test tests/e2e/search-filter.spec.js tests/e2e/search-action.spec.js tests/e2e/inherited-search.spec.js: 12 passed.

A filter navigates to a relative URL. The router keeps it as state.url, and
new URL() throws on it, so a search after a filter did nothing.
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.

Search does nothing after a filter has been used

1 participant