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

[feature] Permit parent page to modify the behavior of the "show filters" button #83

Open
hydrosquall opened this issue Mar 26, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@hydrosquall
Copy link
Member

hydrosquall commented Mar 26, 2022

Motivation

When embedding the data-explorer in a page that uses URL params like the Datasette project (see here ), using the "filters" bar can clobber state that was set by the parent page. It would be useful to be able to let embedders of this component disable this behavior.

Recommendation

  • Add a boolean prop disableFilterControls that defaults to false, which hides the show/hide filter button.
  • (Optional, probably more complex if the component isn't already maintaining internal state): Add a boolean prop disableSetUrlParams that defaults to false, which enables state to be saved internally to the component, doesn't modify the parent page's URL parameters.
@hydrosquall hydrosquall added the enhancement New feature or request label Mar 26, 2022
@hydrosquall
Copy link
Member Author

Concrete example to reproduce

  1. Open the "table" view of a page
  2. Type in a string filter for a string column. For quick previews, the page will live filter the rows, but URL state is intact
  3. Press "enter". The URL params of the page are replaced, any existing params are removed completely.

Alternate solutions

  • URL params should be namespaced by this app (e.g. de.search-filter), params from other apps should be ignored
  • Search configuration could be stored in a URL hash (#) rather than query params

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant