feat: possible solution to description display in combobox #11876
feat: possible solution to description display in combobox #11876Sembauke wants to merge 2 commits intoopenstreetmap:developfrom
Conversation
There was a problem hiding this comment.
Thanks! I think the "solution one" might actually be better: I tried out the branch (solution two) and it happened to me regularly that i slightly misclicked the small ℹ️ icon, thus accidentally selecting the wrong option. For touch devices it might be even more tricky to press the icon. Sure, the icon could be enlarged, but I think that the benefit of having the descriptions collapsible is not really worth the added UI complexity and visual noise.
The only downside for "solution one" would be that there are significantly fewer options visible at once when there are many values available (the parking field is with 13 options currently the one with the most tags that have a description). Maybe this could be counteracted a little by making the maximum height of the dropdown a little larger when the options have descriptions to fit roughly the same number of tags at once (e.g. assuming a single line description for each option).
PS: I also checked how it looks like when the options also have individual icons, and it looks great:
modules/ui/combobox.js
Outdated
|
|
||
| // enter/update | ||
| options.enter() | ||
| var entered = options.enter() |
There was a problem hiding this comment.
PS: Two minor nit-picks:
- Normally we simple use
enteras the variable name for a d3 enter() selection. - Consider using
const(orlet) instead ofvarin new or refactored code.
Why do you think so? In my opinion "Solution one" should work quite well, with the minor tweak that the combobox has a slightly larger Can you try this out in the PR? 😊 Footnotes
|
|
Hey @tyrasd, I have applied my stash and updated the max combo-box height. |


There are two solutions for displaying descriptions in the combo-box. Solution one is the more straightforward approach. Solution two is more comprehensive, but would require disabling the tooltip to avoid redundancy, since by the time a user clicks the information button, the tooltip has already appeared.
The code currently provides the second solution, I can apply my stash any-time.
Below the two different options:
ref #10613