@@ -118,7 +118,6 @@ const Form = forwardRef<HTMLFormElement, FormPropTypes>((props, ref) => {
118
118
labelSpanL = 4 ,
119
119
labelSpanXL = 4 ,
120
120
titleText,
121
- style,
122
121
...rest
123
122
} = props ;
124
123
@@ -134,7 +133,7 @@ const Form = forwardRef<HTMLFormElement, FormPropTypes>((props, ref) => {
134
133
labelSpanMap . set ( 'Desktop' , labelSpanL ) ;
135
134
labelSpanMap . set ( 'LargeDesktop' , labelSpanXL ) ;
136
135
137
- const [ componentRef , formRef ] = useSyncRef < HTMLFormElement > ( ref ) ;
136
+ const [ componentRef , containerRef ] = useSyncRef < HTMLFormElement > ( ref ) ;
138
137
// use the window range set as first best guess, if not available use Desktop
139
138
const [ currentRange , setCurrentRange ] = useState ( Device . getCurrentRange ( ) ?. name ?? 'Desktop' ) ;
140
139
const lastRange = useRef ( currentRange ) ;
@@ -148,14 +147,14 @@ const Form = forwardRef<HTMLFormElement, FormPropTypes>((props, ref) => {
148
147
}
149
148
} ) ;
150
149
151
- if ( formRef . current ) {
152
- observer . observe ( formRef . current ) ;
150
+ if ( containerRef . current ) {
151
+ observer . observe ( containerRef . current ) ;
153
152
}
154
153
155
154
return ( ) => {
156
155
observer . disconnect ( ) ;
157
156
} ;
158
- } , [ formRef ] ) ;
157
+ } , [ containerRef ] ) ;
159
158
160
159
const classes = useStyles ( ) ;
161
160
@@ -246,20 +245,23 @@ const Form = forwardRef<HTMLFormElement, FormPropTypes>((props, ref) => {
246
245
className = { clsx ( classes . formContainer , className ) }
247
246
suppressHydrationWarning = { true }
248
247
ref = { componentRef }
249
- style = { {
250
- ...style ,
251
- '--ui5wcr_form_label_span_s' : labelSpanS ,
252
- '--ui5wcr_form_label_span_m' : labelSpanM ,
253
- '--ui5wcr_form_label_span_l' : labelSpanL ,
254
- '--ui5wcr_form_label_span_xl' : labelSpanXL ,
255
- '--ui5wcr_form_columns_s' : columnsS ,
256
- '--ui5wcr_form_columns_m' : columnsM ,
257
- '--ui5wcr_form_columns_l' : columnsL ,
258
- '--ui5wcr_form_columns_xl' : columnsXL
259
- } }
260
248
{ ...rest }
261
249
>
262
- < div className = { formClassNames } >
250
+ < div
251
+ className = { formClassNames }
252
+ style = {
253
+ {
254
+ '--ui5wcr_form_label_span_s' : labelSpanS ,
255
+ '--ui5wcr_form_label_span_m' : labelSpanM ,
256
+ '--ui5wcr_form_label_span_l' : labelSpanL ,
257
+ '--ui5wcr_form_label_span_xl' : labelSpanXL ,
258
+ '--ui5wcr_form_columns_s' : columnsS ,
259
+ '--ui5wcr_form_columns_m' : columnsM ,
260
+ '--ui5wcr_form_columns_l' : columnsL ,
261
+ '--ui5wcr_form_columns_xl' : columnsXL
262
+ } as CSSProperties
263
+ }
264
+ >
263
265
{ titleText && (
264
266
< Title level = { TitleLevel . H3 } className = { classes . formTitle } >
265
267
{ titleText }
0 commit comments