Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Currently selected array facets are not correctly persisted through hidden form fields #963

Closed
mhalle opened this issue Sep 12, 2020 · 1 comment
Labels

Comments

@mhalle
Copy link

mhalle commented Sep 12, 2020

Faceted search uses JSON array elements as facets rather than the arrays. However, if a search is "Apply"ed (using the Apply button), the array itself rather than its elements used.

To reproduce:
https://latest.datasette.io/fixtures/facetable?_sort=pk&_facet=created&_facet=tags&_facet_array=tags

Press "Apply", which might be done when removing a filter. Notice that the "tags" facet values are now arrays, not array elements. It appears the "&_facet_array=tags" element of the query string is dropped.

@simonw simonw added the bug label Sep 12, 2020
@simonw
Copy link
Owner

simonw commented Sep 12, 2020

Good bug - looks like a problem with the hidden form fields.

@simonw simonw added this to the Datasette 0.49 milestone Sep 12, 2020
@mhalle mhalle changed the title JSON arrays lose faceted elements when search is applied JSON arrays rather than array elements are used when search is applied Sep 12, 2020
@simonw simonw closed this as completed in ea340cf Sep 12, 2020
@simonw simonw changed the title JSON arrays rather than array elements are used when search is applied Currently selected array facets are not correctly persisted through hidden form fields Sep 12, 2020
simonw added a commit that referenced this issue Sep 14, 2020
simonw added a commit that referenced this issue Sep 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants