Skip to content

Commit

Permalink
Bugfix: prevent badge from being positioned at wrong place
Browse files Browse the repository at this point in the history
When the search bar was initialized with no filters (nrSelectedFilters = 0): the badge would be hidden and thereby not positioned next to the filter button. Onc
e a filter was selected (nrSelectedFilters > 0), the badge became visible but wa
sn't positioned correctly.
This is avoided by positioning the badge from the beginning but just making it invisible.
  • Loading branch information
Ronny Roeller committed Jul 24, 2017
1 parent 20d5ef6 commit 52dca65
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion paper-search-bar.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@
--paper-badge-margin-left: -5px;
--paper-badge-margin-bottom: -25px;
}

.badge[invisible] {
visibility: hidden;
}
</style>

<iron-icon icon="[[icon]]" class="icon"></iron-icon>
Expand All @@ -79,7 +83,7 @@
<template is="dom-if" if="{{!disableFilterButton}}">
<paper-icon-button id="filter" icon="image:tune" on-tap="_filter" class="icon"></paper-icon-button>
</template>
<paper-badge for="filter" label="[[nrSelectedFilters]]" class="badge" hidden$="[[!nrSelectedFilters]]"></paper-badge>
<paper-badge for="filter" label="[[nrSelectedFilters]]" class="badge" invisible$="[[!nrSelectedFilters]]"></paper-badge>
</template>
</template>
</dom-module>
Expand Down

0 comments on commit 52dca65

Please sign in to comment.