Skip to content

Commit

Permalink
fix(select): fix delay of arrow icon change on opening popup (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
muratcorlu authored Sep 29, 2022
1 parent c178d69 commit 17ee9be
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
3 changes: 2 additions & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ module.exports = {
'tooltip',
'progress-indicator',
'checkbox',
'alert'
'alert',
'select'
],
],
},
Expand Down
12 changes: 12 additions & 0 deletions src/components/select/bl-select.css
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,18 @@
font-size: var(--bl-font-size-m);
}

.dropdown-icon.open {
display: none;
}

.select-open .dropdown-icon.open {
display: inline-block;
}

.select-open .dropdown-icon.closed {
display: none;
}

.selected .dropdown-icon {
--icon-color: var(--bl-color-secondary);
}
Expand Down
3 changes: 2 additions & 1 deletion src/components/select/bl-select.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ describe('bl-select', () => {
variant="secondary"
>
</bl-button>
<bl-icon class="dropdown-icon" name="arrow_down"></bl-icon>
<bl-icon class="dropdown-icon open" name="arrow_up"></bl-icon>
<bl-icon class="dropdown-icon closed" name="arrow_down"></bl-icon>
</div>
</div>
<div class="popover">
Expand Down
9 changes: 7 additions & 2 deletions src/components/select/bl-select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,13 @@ export default class BlSelect extends LitElement {
<div class="actions">
${removeButton}
<bl-icon
class="dropdown-icon"
name="${this._isPopoverOpen ? 'arrow_up' : 'arrow_down'}"
class="dropdown-icon open"
name="arrow_up"
></bl-icon>
<bl-icon
class="dropdown-icon closed"
name="arrow_down"
></bl-icon>
</div>
</div>`;
Expand Down

0 comments on commit 17ee9be

Please sign in to comment.