From cef69218bea854e434bcd27daf6f442811e06697 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ste=CC=81phane=20Klein?= Date: Sun, 18 Oct 2015 16:05:08 +0200 Subject: [PATCH] Fix bug with Firefox : now cursor is placed at end of string in input text after focus --- bootbox.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bootbox.js b/bootbox.js index 6c7df7b8..c18b3f30 100644 --- a/bootbox.js +++ b/bootbox.js @@ -559,6 +559,18 @@ // need the closure here since input isn't // an object otherwise input.focus(); + if ( + (options.inputType == 'text') || + (options.inputType == 'date') || + (options.inputType == 'email') || + (options.inputType == 'time') || + (options.inputType == 'number') || + (options.inputType == 'password') + ) { + var tmp = input.val(); + input.val(''); + input.val(tmp); + } }); if (shouldShow === true) {