rclement / datasette-dashboards

Datasette plugin providing data dashboards from metadata
https://datasette-dashboards-demo.vercel.app
Apache License 2.0
137 stars 7 forks source link

Automatically switch select filter to autocomplete text filter #160

Closed rclement closed 1 year ago

rclement commented 1 year ago

When more than 100 options are provided, switch select filter to autocomplete text filter.

Implementation is performed using native HTML datalist element, avoiding the use of JavaScript alltogether. All major browsers support this feature and usually are performing some kind of full-text search on the list which is a nice addition to the autocompletion feature itself.

Here is how it looks like in various browsers:

Firefox:

firefox

Chrome:

chrome

Safari:

safari
codecov[bot] commented 1 year ago

Codecov Report

Merging #160 (72994f8) into master (b4ba997) will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master      #160   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            8         8           
  Lines          388       401   +13     
  Branches        73        76    +3     
=========================================
+ Hits           388       401   +13     
Files Changed Coverage Δ
tests/test_dashboard_view.py 100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more