From 7aafa2148d4ad2eda273db98beaba14338457c73 Mon Sep 17 00:00:00 2001 From: Erik Harper Date: Thu, 18 Aug 2022 10:03:12 -0700 Subject: [PATCH 1/3] fix(input): input no longer loses focus when Safari autofills the field --- src/demos/input.html | 1337 ++---------------------------------------- 1 file changed, 43 insertions(+), 1294 deletions(-) diff --git a/src/demos/input.html b/src/demos/input.html index 8516bce776d..d51d9977bc0 100644 --- a/src/demos/input.html +++ b/src/demos/input.html @@ -115,1313 +115,62 @@ - - - - -
-
-
Small
-
Medium
-
Large
-
+

This page is to test browser autofill of email and password fields.

- -
-
Standard
-
- - Input Label - - -
+
+ + Regular input + + -
- - Input Label - - -
+ + Email + + -
- - Input Label - - -
-
+ + Password + + - -
-
Standard with icon
-
- - Input Label - - -
+ submit + -
- - Input Label - - -
+ -
- - Input Label - - -
-
- - -
-
Standard Prefix/Suffix
-
- - Input Label - - -
- -
- - Input Label - - -
- -
- - Input Label - - -
-
- - -
-
Number Vertical
-
- - Input Label - - -
- -
- - Input Label - - -
- -
- - Input Label - - -
-
- - -
-
Number Vertical Prefix/Suffix
-
- - Input Label - - - -
- -
- - Input Label - - - -
- -
- - Input Label - - - -
-
- - -
-
Number Horizontal
-
- - Input Label - - - -
- -
- - Input Label - - - -
- -
- - Input Label - - - -
-
- - -
-
Number Horizontal Prefix/Suffix
-
- - Input Label - - - -
- -
- - Input Label - - - -
- -
- - Input Label - - - -
-
- - -
-
Color Picker
-
- - Color input - - -
- -
- - Color input - - -
- -
- - Color input - - -
-
- - -
-
File upload
-
- - File input - - -
- -
- - File input - - -
- -
- - File input - - -
-
- - -
-
Text area
-
- - File input - - -
- -
- - File input - - -
- -
- - File input - - -
-
- -
- -
-
Filled(can edit)
-
- - Filled spinner input - - - -
-
- - Filled spinner input - - - -
- -
- - Filled spinner input - - - -
-
-
-
Read Only (can't edit)
-
- - Read only spinner input - - - -
-
- - Read only spinner input - - - -
- -
- - Read only spinner input - - - -
-
-
-
Disabled (can't edit)
-
- - Disabled spinner input - - - -
-
- - Disabled spinner input - - - -
-
- - Disabled spinner input - - - -
-
-
- - -
-
-
Date-picker
-
- -
-
-
Small
-
Medium
-
Large
-
- - -
-
Text area
-
- - - -
- -
- - - -
- -
- - - -
-
- - -
-
Range
-
- -
- -
- -
- -
- -
-
- - -
-
Range Vertical
-
- -
- -
- -
- -
- -
-
- - -
-
Start day of locale
-
- - - -
- -
- - - -
- -
- - - -
-
- -
- - -
-
-
Time-picker
-
- -
-
-
Small
-
Medium
-
Large
-
- - -
-
Standard
-
- - - -
- -
- - - -
- -
- - - -
-
- - -
-
With seconds
-
- -
- -
- -
- -
- -
-
- - -
-
Null
-
- -
- -
- -
- -
- -
-
- -
- - -
-
-
Messages
-
- -
-
-
Small
-
Medium
-
Large
-
- - -
-
Message Info
-
- - - Info message - -
- -
- - - Info message - -
- -
- - - Info message - -
-
- - -
-
Message Success
-
- - - Success message - -
- -
- - - Success message - -
- -
- - - Success message - -
-
- - -
-
Message Warning
-
- - - - Warning message - - -
- -
- - - - Warning message - - -
- -
- - - - Warning message - - -
-
- - -
-
Message Error
-
- - - Error message - -
- -
- - - Error message - -
- -
- - - Error message - -
-
- -
- - -
-
-
Error states
-
- -
-
-
Small
-
Medium
-
Large
-
- - -
-
Standard
-
- - Input Label - - Error message - -
- -
- - Input Label - - Error message - -
- -
- - Input Label - - Error message - -
-
- - -
-
Prefix/Suffix
-
- - Input Label - - Error message - -
- -
- - Input Label - - Error message - -
- -
- - Input Label - - Error message - -
-
- - -
-
Color
-
- - Input Label - - Error message - -
- -
- - Input Label - - Error message - -
- -
- - Input Label - - Error message - -
-
- - -
-
Number
-
- - Input Label - - Error message - -
- -
- - Input Label - - Error message - -
- -
- - Input Label - - Error message - -
-
- - -
-
File upload
-
- - File input - - Error message - -
- -
- - File input - - Error message - -
- -
- - File input - - Error message - -
-
- -
- - - -
-
-
Number input
-
- -
- -
-
-
-
- - - -
-
-
- Reset -
-
- -
- - -
-
-
Locales
-
- - -
-
default locale number input
-
- -
-
- - -
-
default locale number input with group
-
- -
-
- - -
-
french number input
-
- -
-
- - -
-
french number input with group separator
-
- -
-
+ - -
-
minlength=2 maxlength=3
-
- -
-
+

Native inputs:

- -
-
no-locale number
-
- -
-
+
+ - -
-
arabic
-
- -
-
+ - -
-
french-whole
-
- -
-
+ submit +
- -
-
french-novalue
-
- -
-
+ - -
-
step-any
-
- -
-
-
- From 555160d3884ed4c1d15e49af261025e0753030aa Mon Sep 17 00:00:00 2001 From: Erik Harper Date: Thu, 25 Aug 2022 16:48:04 -0700 Subject: [PATCH 2/3] fix(input): preventing the input from losing focus on keypress in Safari when autofill occurs --- src/utils/form.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils/form.tsx b/src/utils/form.tsx index ab861bf4936..37c29b5193a 100644 --- a/src/utils/form.tsx +++ b/src/utils/form.tsx @@ -292,6 +292,8 @@ function syncHiddenFormInput(component: FormComponent): void { docFrag = ownerDocument!.createDocumentFragment(); } + input.inert = true; + docFrag.append(input); // emits when hidden input is autofilled From 071403a9aa5413a4e704a83c019eb11232b28c48 Mon Sep 17 00:00:00 2001 From: Erik Harper Date: Thu, 25 Aug 2022 16:57:11 -0700 Subject: [PATCH 3/3] restoring input.html --- src/demos/input.html | 1337 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 1294 insertions(+), 43 deletions(-) diff --git a/src/demos/input.html b/src/demos/input.html index d51d9977bc0..8516bce776d 100644 --- a/src/demos/input.html +++ b/src/demos/input.html @@ -115,62 +115,1313 @@ -

This page is to test browser autofill of email and password fields.

+ + + + +
+
+
Small
+
Medium
+
Large
+
-
- - Regular input - - + +
+
Standard
+
+ + Input Label + + +
- - Email - - +
+ + Input Label + + +
- - Password - - +
+ + Input Label + + +
+
- submit -
+ +
+
Standard with icon
+
+ + Input Label + + +
- +
+ + Input Label + + +
- + +
+
Standard Prefix/Suffix
+
+ + Input Label + + +
-

Native inputs:

+
+ + Input Label + + +
-
- +
+ + Input Label + + +
+
- + +
+
Number Vertical
+
+ + Input Label + + +
- submit - +
+ + Input Label + + +
- +
+ + Input Label + + +
+
- + +
+
+
+ Reset +
+
+ +
+ + +
+
+
Locales
+
+ + +
+
default locale number input
+
+ +
+
+ + +
+
default locale number input with group
+
+ +
+
+ + +
+
french number input
+
+ +
+
+ + +
+
french number input with group separator
+
+ +
+
+ + +
+
set to undefined
+
+ +
+
+ + +
+
minlength=2 maxlength=3
+
+ +
+
+ + +
+
no-locale number
+
+ +
+
+ + +
+
arabic
+
+ +
+
+ + +
+
french-whole
+
+ +
+
+ + +
+
french-novalue
+
+ +
+
+ + +
+
step-any
+
+ +
+
+ + +