-
Notifications
You must be signed in to change notification settings - Fork 32
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
feat: update select dropdown to match multiselect one #516
Conversation
Affected libs:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @f-necas for the big work! The visual result is really nice and identical to the multi-dropdown.
However, the app currently breaks if choice
is undefined in the dropdown-selector
. Can easily be tested with records without data for the previews. Also noticed two minor issues in the UI:
I've left corresponding comments inline.
libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.ts
Outdated
Show resolved
Hide resolved
libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.ts
Outdated
Show resolved
Hide resolved
libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.html
Show resolved
Hide resolved
libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.html
Outdated
Show resolved
Hide resolved
badf863
to
4a415f3
Compare
Thanks for your review @tkohr. I've updated the code in order to :
|
4a415f3
to
f80282b
Compare
libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.html
Outdated
Show resolved
Hide resolved
return ( | ||
this.selectedChoice.label.substring(0, 50) + | ||
(this.selectedChoice.label.length > 50 ? '...' : '') | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we achieve this with a truncate
via CSS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have done a truncate in css BUT couldn't set parent as flex
in map-view component. When external link is displayed , it's not on the same line. Couldn't figure it out why flex
is breaking the css truncate thing.
min-w-0
is also mandatory to have the truncate working...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't followed the discussion but TW provide a truncate
class for ellipsis. It's not about flex.
https://tailwindcss.com/docs/text-overflow#truncate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't followed the discussion but TW provide a
truncate
class for ellipsis. It's not about flex. https://tailwindcss.com/docs/text-overflow#truncate
Yeah I know and use it already, but the flex class on a parent breaks his behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hum, indeed it doesn't seem simple to make the cascaded truncate
work within the flex
here. A <div class="truncate">
wrapper directly under the flex helps to apply the truncate
further down, but also cuts borders etc. because of the overflow-hidden
.
We really need to keep the flex justify-end
layout in the map-view.component
, though, to keep a fitting design for short/normal dropdown entries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.html
Show resolved
Hide resolved
@@ -21,6 +22,7 @@ export default { | |||
imports: [ | |||
ChartComponent, | |||
HttpClientModule, | |||
OverlayModule, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should import the UiInputs module here instead, as OverlayModule is an underlying dependency
<input | ||
class="w-[0px] h-[18px] align-text-top shrink-0" | ||
type="text" | ||
[checked]="isSelected(choice)" | ||
(click)="onSelectValue(choice)" | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -1,23 +1,25 @@ | |||
<div class="w-full h-full flex flex-col"> | |||
<div | |||
class="flex flex-col space-y-2 sm:flex-row sm:space-y-0 sm:space-x-2 justify-between text-[13px]" | |||
class="flex flex-col flex-wrap space-y-2 sm:flex-row sm:space-y-0 sm:space-x-2 justify-between text-[13px] gap-4" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In principle, when modifying a presentation component, we shouldn't have to modify anything that uses this component. Otherwise this indicates that the encapsulation is broken and that our changes are leaking "outside" of the modified component scope.
In that case I think it is acceptable to adjust options because the dropdown is a little bit larger, but modifying the layout (introducing flex-wrap
etc.) is a too big change in my opinion.
Thanks for the extensive work on this @f-necas, this PR is clearly very close to be good to go. However as discussed I think we should refrain from merging it before shipping 1.1, as it might have unexpected side effects and is IMO not strictly required for the release. Sorry if that is disappointing 😬 |
8dfcad7
to
9a20665
Compare
af9465f
to
519fc7a
Compare
519fc7a
to
511fa37
Compare
e848206
to
6451801
Compare
* show selected item Also modified button: * removing minus margin and add hidden border to buttons
6451801
to
1519aee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're in a pretty good state now. @f-necas you can merge whenever you feel that the PR is ready! Thanks for the continued effort.
An overlay has been set to be as closed as the multiselect dropdown.
Sometimes the selected value is a string or an object. I made the majority of the changes in the dropdown component in order to keep the original behavior of each parent component.