Skip to content

Instantly share code, notes, and snippets.

@filipelinhares
Last active September 18, 2018 03:44
Show Gist options
  • Select an option

  • Save filipelinhares/495aefb5d34ef80fa02ba3c50c37df13 to your computer and use it in GitHub Desktop.

Select an option

Save filipelinhares/495aefb5d34ef80fa02ba3c50c37df13 to your computer and use it in GitHub Desktop.

Revisions

  1. filipelinhares revised this gist Sep 18, 2018. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion set-selection-range.js
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,2 @@
    console.log('lorem v2');
    var defer = typeof requestAnimationFrame !== 'undefined' ? requestAnimationFrame : setTimeout
    defer( function () { element[0].setSelectionRange(element[0].selectionStart + 1, element[0].selectionStart + 1, 'none') }, 0)
  2. filipelinhares created this gist Feb 6, 2018.
    3 changes: 3 additions & 0 deletions set-selection-range.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    console.log('lorem v2');
    var defer = typeof requestAnimationFrame !== 'undefined' ? requestAnimationFrame : setTimeout
    defer( function () { element[0].setSelectionRange(element[0].selectionStart + 1, element[0].selectionStart + 1, 'none') }, 0)