From 1ca77fdde1ee58c7e6be9fa9d613fc0b33f2b7b2 Mon Sep 17 00:00:00 2001 From: Hidden50 Date: Fri, 29 Sep 2017 19:14:54 +0200 Subject: [PATCH] Fix crash on browser console when typing "/r " (#1014) `e.setSelectionRange` is a typo, `setSelectionRange` is a property of the textbox element. Results in `Uncaught TypeError: e.setSelectionRange is not a function` when the user types in ``"/r "``. --- js/client-chat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/client-chat.js b/js/client-chat.js index ca2385d92..ff3f124a8 100644 --- a/js/client-chat.js +++ b/js/client-chat.js @@ -159,7 +159,7 @@ e.stopPropagation(); var val = '/pm ' + app.user.lastPM + ', '; textbox.value = val; - e.setSelectionRange(val.length, val.length); + textbox.setSelectionRange(val.length, val.length); } }, clickUsername: function (e) {