Skip to content

Commit e52af19

Browse files
authored
Merge pull request #3333 from Vizzuality/fix/interaction-fixes-for-selector
Fix/interaction fixes for selector
2 parents 0809dbb + 843b420 commit e52af19

File tree

3 files changed

+26
-7
lines changed

3 files changed

+26
-7
lines changed

app/javascript/components/dropdown/components/item.jsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,15 @@ const Item = props => {
3737
className={`item-wrapper
3838
${isActive ? 'show' : ''}
3939
${!group ? 'base' : ''}
40+
${isGroupParentActive ? 'selected' : ''}
41+
${groupParent ? 'group-parent' : ''}
4042
`}
4143
>
4244
{isGroupParentActive && (
4345
<Icon
4446
icon={arrowDownIcon}
45-
className={`group-icon ${
46-
showGroup === groupParent ? 'selected' : ''
47-
}`}
47+
className="group-icon selected"
48+
onClick={() => handleSelectGroup(item)}
4849
/>
4950
)}
5051
<div

app/javascript/components/dropdown/dropdown-styles.scss

+21-3
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,33 @@ $dd-font-size: rem(13px);
175175
max-height: rem(16px);
176176
}
177177

178+
.group-parent {
179+
.item {
180+
padding-right: rem(25px);
181+
z-index: 2;
182+
}
183+
184+
&.selected {
185+
.item {
186+
padding-right: rem(10px);
187+
padding-left: rem(30px);
188+
}
189+
}
190+
191+
.group-icon {
192+
z-index: 1;
193+
}
194+
}
195+
178196
.group-icon {
179-
margin-right: rem(10px);
180197
transform: rotate(-90deg);
181198
fill: $slate;
199+
position: absolute;
200+
right: rem(10px);
182201

183202
&.selected {
184203
transform: rotate(90deg);
185-
margin-right: 0;
186-
margin-left: rem(10px);
204+
left: rem(10px);
187205
}
188206
}
189207

app/javascript/components/dropdown/dropdown.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class DropdownContainer extends PureComponent {
105105

106106
handleClearSelection = clearSelection => {
107107
clearSelection();
108-
this.setState({ isOpen: false });
108+
this.setState({ isOpen: false, showGroup: '' });
109109
};
110110

111111
handleSelectGroup = item => {

0 commit comments

Comments
 (0)