This commit is contained in:
Mo Bitar
2020-04-13 18:39:25 -05:00
parent 82f71aa923
commit ef66170ba4
10 changed files with 134 additions and 118 deletions

View File

@@ -3,9 +3,9 @@ export function selectOnClick($window: ng.IWindowService) {
return {
restrict: 'A',
link: function(scope: ng.IScope, element: JQLite) {
element.on('focus', function() {
element.on('focus', () => {
if (!$window.getSelection()!.toString()) {
const input = element as any;
const input = element[0] as HTMLInputElement;
/** Required for mobile Safari */
input.setSelectionRange(0, input.value.length);
}