day8 / re-com

A ClojureScript library of reusable components for Reagent
https://re-com.day8.com.au
MIT License
796 stars 147 forks source link

tag-dropdown silently hides options #230

Closed mike-thompson-day8 closed 3 years ago

mike-thompson-day8 commented 3 years ago

When too many choices are selected, and the component runs out of horizontal space, choices are silently dropped off which is a bad UX. Here's a demonstration from the Demo app ...

image

Solutions:

  1. add a ... at the end? Perhaps more wordy ... 3 more
  2. cause the containing box to expand vertically to allow for another row of tags?
  3. let the component grow horizontally somehow?

What other solutions?

mike-thompson-day8 commented 3 years ago

And it also hides the "ghost"

image

schpaa commented 3 years ago

Other solution; perhaps a drop down indicator?

mike-thompson-day8 commented 3 years ago

Where the names of the selected choices collectively get too wide/long, a programmer will have two strategies:

  1. to allow the component to grow horizontally by providing :min-width and :max-width args
  2. A programmer can configure the component to "switch" to using "abbreviations" when "names" get too wide. Provide an :abbrev-fn and an :abbrev-threshold over which abbreviations should be used instead of name.
superstructor commented 3 years ago

Resolved with:

  1. :min-width and :max-width arguments
  2. :abbrev-fn and :abbrev-threshold

See above comment and documentation at https://re-com.day8.com.au/