Skip to content

Commit

Permalink
fix(account): uiSelect rendering bugs (#1461)
Browse files Browse the repository at this point in the history
This commit fixes rendering bugs with newer `uiSelect` and implements
them on both the Simple Vouchers html file and the `bhAccountSelect`
component.

This issue is that `uiSelect`'s CSS selects all child `span` elements
under the ui-select options rather than the first one.  It sets them to
be width `100%`, causing the browser to render any sibling elements
unpredictably.

This has been corrected by removing all children spans except for the
main span element.
  • Loading branch information
jniles committed Apr 6, 2017
1 parent b7a8aca commit c7cecb8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion client/src/partials/templates/bhAccountSelect.tmpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
on-select="$ctrl.onSelect($item, $model)"
ng-required="$ctrl.required">
<ui-select-match placeholder="{{ ::'FORM.PLACEHOLDERS.ACCOUNT' | translate }}">
<strong>{{$select.selected.number}}</strong> <span>{{$select.selected.label}}</span>
<span><strong>{{$select.selected.number}}</strong> {{$select.selected.label}}</span>
</ui-select-match>
<ui-select-choices
ui-select-focus-patch
Expand Down
12 changes: 6 additions & 6 deletions client/src/partials/vouchers/simple.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@
ng-model="SimpleVoucherCtrl.Voucher.store.data[0].account_id"
required>
<ui-select-match placeholder="{{ ::'FORM.PLACEHOLDERS.ACCOUNT' | translate }}">
<strong>{{$select.selected.number}}</strong> <span>{{$select.selected.label}}</span>
<span><strong>{{$select.selected.number}}</strong> {{$select.selected.label}}</span>
</ui-select-match>
<ui-select-choices
ui-select-focus-patch
ui-disable-choice="account.type_id === SimpleVoucherCtrl.bhConstants.accounts.TITLE"
repeat="account.id as account in SimpleVoucherCtrl.Voucher.accounts | filter: { 'hrlabel' : $select.search }">
<strong ng-bind-html="account.number | highlight:$select.search"></strong>
<span ng-bind-html="account.label | highlight:$select.search"></span>
<strong ng-bind-html="account.number | highlight:$select.search"></strong>
<span ng-bind-html="account.label | highlight:$select.search"></span>
</ui-select-choices>
</ui-select>

Expand All @@ -142,14 +142,14 @@
ng-model="SimpleVoucherCtrl.Voucher.store.data[1].account_id"
required>
<ui-select-match placeholder="{{ ::'FORM.PLACEHOLDERS.ACCOUNT' | translate }}">
<strong>{{$select.selected.number}}</strong> <span>{{$select.selected.label}}</span>
<span><strong>{{$select.selected.number}}</strong> {{$select.selected.label}}</span>
</ui-select-match>
<ui-select-choices
ui-select-focus-patch
ui-disable-choice="account.type_id === SimpleVoucherCtrl.bhConstants.accounts.TITLE"
repeat="account.id as account in SimpleVoucherCtrl.Voucher.accounts | filter: { 'hrlabel' : $select.search }">
<strong ng-bind-html="account.number | highlight:$select.search"></strong>
<span ng-bind-html="account.label | highlight:$select.search"></span>
<strong ng-bind-html="account.number | highlight:$select.search"></strong>
<span ng-bind-html="account.label | highlight:$select.search"></span>
</ui-select-choices>
</ui-select>

Expand Down

0 comments on commit c7cecb8

Please sign in to comment.