Skip to content

Commit

Permalink
fix(bhFindPatient): make input focusable
Browse files Browse the repository at this point in the history
This commit fixes a uib-dropdown issue #6364 by making the button into
an anchor tag.
  • Loading branch information
Jonathan Niles authored and jniles committed Jan 5, 2017
1 parent 71b7b07 commit d4112f5
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions client/src/partials/templates/bhFindPatient.tmpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,20 @@
ng-class="{
'has-success': !$ctrl.showSearchView && $ctrl.loadStatus=='loaded',
'has-error': (!$ctrl.showSearchView && $ctrl.loadStatus=='error') || ($ctrl.validationTrigger && $ctrl.loadStatus != 'loaded')
}"
>
<label class="control-label text-capitalize">{{ "FORM.LABELS.PATIENT" | translate }}</label>
}">
<label class="control-label text-capitalize" translate>FORM.LABELS.PATIENT</label>

<!-- input zone -->
<div class="input-group" ng-if="$ctrl.showSearchView">

<div class="input-group-btn" uib-dropdown tabindex=-1>
<button class="btn btn-default" type="button" uib-dropdown-toggle data-find-patient-dropdown-toggle tabindex=-1>
{{ $ctrl.selected.label | translate }} <span class="caret"></span>
</button>
<div class="input-group-btn" uib-dropdown>
<a class="btn btn-default" type="button" uib-dropdown-toggle data-find-patient-dropdown-toggle>
<span translate>{{ $ctrl.selected.label }}</span> <span class="caret"></span>
</a>
<ul uib-dropdown-menu>
<li ng-repeat="(key, option) in $ctrl.options">
<a href ng-click="$ctrl.findBy(key)" data-find-patient-option="{{ option.label }}">
{{ option.label | translate }}
<a href ng-click="$ctrl.findBy(key)" data-find-patient-option="{{ ::option.label }}" translate>
{{ ::option.label }}
</a>
</li>
</ul>
Expand All @@ -30,11 +29,9 @@
class="form-control"
name="idInput"
ng-model="$ctrl.idInput"
ng-model-options="{ 'debounce' : { 'default' : 150, 'blur' : 0 }}"
ng-if="$ctrl.selected == $ctrl.options.findById"
ng-keypress="$ctrl.onKeyPress($event)"
placeholder="{{ $ctrl.selected.placeholder | translate }}..."
autocomplete="off"
ng-required="$ctrl.required">

<!-- search by Name -->
Expand All @@ -43,7 +40,6 @@
class="form-control"
name="nameInput"
ng-model="$ctrl.nameInput"
ng-model-options="{ 'debounce' : { 'default' : 150, 'blur' : 0 }}"
ng-if="$ctrl.selected == $ctrl.options.findByName"
ng-keypress="$ctrl.onKeyPress($event)"
uib-typeahead="patient as patient.label for patient in $ctrl.searchByName($viewValue)"
Expand All @@ -52,7 +48,6 @@
typeahead-template-url="/partials/templates/patientList.tmpl.html"
typeahead-on-select="$ctrl.selectPatient($item)"
placeholder="{{ $ctrl.selected.placeholder | translate }}..."
autocomplete="off"
ng-required="$ctrl.required">

<!-- submit button for search by ID -->
Expand All @@ -63,7 +58,7 @@
ng-disabled="FindPatientForm.idInput.$invalid"
ng-click="$ctrl.submit()"
data-find-patient-submit>
{{ "FORM.BUTTONS.SEARCH" | translate }}
<span translate>FORM.BUTTONS.SEARCH</span>
</button>
</span>
</div>
Expand Down

0 comments on commit d4112f5

Please sign in to comment.