@@ -7,12 +7,25 @@ class FormSupport {
7
7
* @param nativeInputUpdateCallback - determines how the native input's disabled and value properties are calculated
8
8
*/
9
9
static syncNativeHiddenInput ( element , nativeInputUpdateCallback ) {
10
- const needsNativeInput = ! ! element . name ;
11
- let nativeInput = element . querySelector ( "input[type=hidden][ data-ui5-form-support]" ) ;
10
+ const needsNativeInput = ! ! element . name || element . required ;
11
+ let nativeInput = element . querySelector ( "input[data-ui5-form-support]" ) ;
12
12
if ( needsNativeInput && ! nativeInput ) {
13
13
nativeInput = document . createElement ( "input" ) ;
14
- nativeInput . type = "hidden" ;
14
+
15
+ nativeInput . style . clip = "rect(0 0 0 0)" ;
16
+ nativeInput . style . clipPath = "inset(50%)" ;
17
+ nativeInput . style . height = "1px" ;
18
+ nativeInput . style . overflow = "hidden" ;
19
+ nativeInput . style . position = "absolute" ;
20
+ nativeInput . style . whiteSpace = "nowrap" ;
21
+ nativeInput . style . width = "1px" ;
22
+ nativeInput . style . bottom = "0" ;
23
+ nativeInput . setAttribute ( "tabindex" , "-1" ) ;
24
+ nativeInput . required = element . required ;
15
25
nativeInput . setAttribute ( "data-ui5-form-support" , "" ) ;
26
+
27
+ nativeInput . addEventListener ( "focusin" , event => element . focus ( ) ) ;
28
+
16
29
nativeInput . slot = "formSupport" ; // Needed for IE - otherwise input elements are not part of the real DOM tree and are not detected by forms
17
30
element . appendChild ( nativeInput ) ;
18
31
}
0 commit comments