Skip to content
This repository was archived by the owner on Jun 29, 2022. It is now read-only.

Commit 56138c4

Browse files
author
Lukasz Kokot
committed
✨ Add option for not trimming input value
We add a "trim" option that is by default set to "true", in order for the component to stay backward compatible. However, when this property is set to "false", the value is the one directly entered by the user, with all whitespaces left untouched.
1 parent 0325aee commit 56138c4

15 files changed

+99
-26
lines changed

dist/select.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
22
* ui-select
33
* http://github.com/angular-ui/ui-select
4-
* Version: 0.19.8 - 2017-12-20T18:40:38.492Z
4+
* Version: 0.19.8 - 2020-01-17T13:11:27.917Z
55
* License: MIT
66
*/
77

dist/select.js

Lines changed: 23 additions & 14 deletions
Large diffs are not rendered by default.

dist/select.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/select.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/select.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/bootstrap/select-multiple.tpl.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
aria-expanded="{{$select.open}}"
1616
aria-label="{{$select.baseTitle}}"
1717
ng-class="{'spinner': $select.refreshing}"
18+
ng-trim="{{ $select.trim }}"
1819
ondrop="return false;">
1920
<input type="text"
2021
tabindex="-1"

src/bootstrap/select.tpl.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
ng-class="{ 'ui-select-search-hidden' : !$select.searchEnabled }"
1010
placeholder="{{$select.placeholder}}"
1111
ng-model="$select.search"
12-
ng-show="$select.open">
12+
ng-show="$select.open"
13+
ng-trim="{{ $select.trim }}">
1314
<div class="ui-select-choices"></div>
1415
<div class="ui-select-no-choice"></div>
1516
</div>

src/common.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ var uis = angular.module('ui.select', [])
131131
appendDropdownToBody: false,
132132
spinnerEnabled: false,
133133
spinnerClass: 'glyphicon glyphicon-refresh ui-select-spin',
134-
backspaceReset: true
134+
backspaceReset: true,
135+
trim: true
135136
})
136137

137138
// See Rename minErr and make it accessible from outside https://github.com/angular/angular.js/issues/6913

src/select2/select-multiple.tpl.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
ng-hide="$select.disabled"
2222
ng-model="$select.search"
2323
ng-click="$select.activate()"
24+
ng-trim="{{ $select.trim }}"
2425
style="width: 34px;"
2526
ondrop="return false;">
2627
<input type="text" tabindex="-1"

src/select2/select.tpl.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<input type="search" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
1111
ng-class="{'select2-active': $select.refreshing}"
1212
role="combobox"
13+
ng-trim="{{ $select.trim }}"
1314
aria-expanded="true"
1415
aria-owns="ui-select-choices-{{ $select.generatedId }}"
1516
aria-label="{{ $select.baseTitle }}"

0 commit comments

Comments
 (0)