Skip to content

Commit

Permalink
fix(vouchers): autofocus ui-select input
Browse files Browse the repository at this point in the history
This commit implements the ui-select autofocus hack on the complex
voucher's ui-select.  When the dropdown is clicked, the input is now
selected.

Closes #1957.
  • Loading branch information
jniles committed Oct 26, 2017
1 parent 72af815 commit b4c4393
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions client/src/modules/templates/bhUserSelect.tmpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<label class="control-label" translate>
FORM.LABELS.USER
</label>

<ng-transclude></ng-transclude>
<ui-select name="user_id"
<ui-select name="user_id"
ng-model="$ctrl.userId"
on-select="$ctrl.onSelect($item, $model)">
<ui-select-match placeholder="{{ 'FORM.SELECT.USER' | translate }}"><span>{{$select.selected.display_name}}</span></ui-select-match>
Expand Down
8 changes: 4 additions & 4 deletions client/src/modules/vouchers/complex-voucher.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,20 +102,20 @@
</span>
</label>

<!-- financial transaction -->
<!-- Select a Transaction Type -->
<ui-select
name="type_id"
ng-model="ComplexVoucherCtrl.Voucher.details.type_id"
ng-required="ComplexVoucherCtrl.Voucher.hasCashboxAccount"
ng-change="ComplexVoucherCtrl.Voucher.validate()"
append-to-body="true">
on-select="ComplexVoucherCtrl.Voucher.validate()">

<ui-select-match placeholder="{{ 'FORM.SELECT.TRANSFER_TYPE' | translate }}">
<span translate>{{ $select.selected.text }}</span>
</ui-select-match>

<ui-select-choices
repeat="item.id as item in ComplexVoucherCtrl.types | filter:{ 'hrText' : $select.search }"
ui-select-focus-patch
repeat="item.id as item in ComplexVoucherCtrl.types | filter: { hrText : $select.search }"
group-by="'type'">
<div ng-bind-html="item.hrText | highlight: $select.search"></div>
</ui-select-choices>
Expand Down

0 comments on commit b4c4393

Please sign in to comment.