src/components/chips/chips.spec.js
function updateInputCursor() {
            if (isValidInput) {
              var inputLength = input[0].value.length;

              try {
                input[0].selectionStart = input[0].selectionEnd = inputLength;
              } catch (e) {
                // Chrome does not allow setting a selection for number inputs and just throws
                // a DOMException as soon as something tries to set a selection programmatically.
                // Faking the selection properties for the ChipsController works for our tests.
                var selectionDescriptor = { writable: true, value: inputLength };
                Object.defineProperty(input[0], 'selectionStart', selectionDescriptor);
                Object.defineProperty(input[0], 'selectionEnd', selectionDescriptor);
              }
            }
          }
function updateInputCursor() {
            if (isValidInput) {
              var inputLength = input[0].value.length;

              try {
                input[0].selectionStart = input[0].selectionEnd = inputLength;
              } catch (e) {
                // Chrome does not allow setting a selection for number inputs and just throws
                // a DOMException as soon as something tries to set a selection programmatically.
                // Faking the selection properties for the ChipsController works for our tests.
                var selectionDescriptor = { writable: true, value: inputLength };
                Object.defineProperty(input[0], 'selectionStart', selectionDescriptor);
                Object.defineProperty(input[0], 'selectionEnd', selectionDescriptor);
              }
            }
          }
function updateInputCursor ( ) { if ( isValidInput ) { var inputLength = input [ 0 ] . value . length ; try { input [ 0 ] . selectionStart = input [ 0 ] . selectionEnd = inputLength ; } catch ( e ) { // Chrome does not allow setting a selection for number inputs and just throws // a DOMException as soon as something tries to set a selection programmatically. // Faking the selection properties for the ChipsController works for our tests. var selectionDescriptor = { writable : true , value : inputLength } ; Object . defineProperty ( input [ 0 ] , 'selectionStart' , selectionDescriptor ) ; Object . defineProperty ( input [ 0 ] , 'selectionEnd' , selectionDescriptor ) ; } } }
Updates the cursor position of the input.
This is necessary to test the cursor position.
Updates the cursor position of the input . This is necessary to test the cursor position .