From 0a9ad08e9e98645b8d8d53a0d4f56558a2aa8a78 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 4 Jul 2015 19:26:42 -0400 Subject: Set cursor at the end of selection on focus for search input (compatible with Firefox) --- assets/js/src/base.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'assets/js/src') diff --git a/assets/js/src/base.js b/assets/js/src/base.js index ab9e59a9..b2a78424 100644 --- a/assets/js/src/base.js +++ b/assets/js/src/base.js @@ -236,7 +236,9 @@ var Kanboard = (function() { // Place cursor at the end when focusing on the search box $(document).on("focus", "#form-search", function() { - $(this).val($(this).val()); + if ($("#form-search")[0].setSelectionRange) { + $('#form-search')[0].setSelectionRange($('#form-search').val().length, $('#form-search').val().length); + } }); // Filter helper for search -- cgit v1.2.3