From 453b0106d22851756516ce6bdfb91d92ce45e349 Mon Sep 17 00:00:00 2001 From: Alex Osman Date: Sat, 18 Nov 2017 14:20:39 -0500 Subject: [PATCH] fixes default for input elements --- src/modules/init/content.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/modules/init/content.ts b/src/modules/init/content.ts index 04d143f1..b81ec5a6 100644 --- a/src/modules/init/content.ts +++ b/src/modules/init/content.ts @@ -30,12 +30,14 @@ const addInputEvents = (input: HTMLElement): void => { /* * FIXME (this is a bit hacky) - * We're overwriting the default value of confirm button, - * as well as overwriting the default focus on the button + * Set the focus to the input + * Overwrite the submit value with the + * value of the input element ("" or value/defaultValue) */ setTimeout(() => { input.focus(); - setActionValue(''); + const defaultValue = (input as HTMLInputElement).value; + setActionValue(defaultValue) }, 0); };