@@ -39,7 +39,7 @@ import { useLatest } from '../../hooks/useLatest/index.js';
39
39
import { useI18n } from '../../hooks/useI18n/useI18n.js' ;
40
40
41
41
import { getFirstFocusableElement } from './DialogService.js' ;
42
- import classes from './dialog .module.css' ;
42
+ import classes from './Dialog .module.css' ;
43
43
import { translations } from './translations/index.js' ;
44
44
45
45
type DataAttribute = `data-${string } `;
@@ -248,20 +248,14 @@ export const Dialog = forwardRef<HTMLDialogElement, DialogProps>(
248
248
if ( ! dialogElement ) {
249
249
return ;
250
250
}
251
-
252
- if ( ! hasNativeDialog && isModal ) {
253
- ( dialogElement . nextSibling as HTMLDivElement ) . classList . remove (
254
- classes [ 'backdrop-visible' ] ,
255
- ) ;
256
- }
257
251
onCloseStart ?.( ) ;
258
252
// trigger closing of the dialog after animation
259
253
setTimeout ( ( ) => {
260
254
if ( dialogElement . open ) {
261
255
dialogElement . close ( ) ;
262
256
}
263
257
} , animationDurationRef . current ) ;
264
- } , [ hasNativeDialog , animationDurationRef . current , isModal , onCloseStart ] ) ;
258
+ } , [ animationDurationRef . current , onCloseStart ] ) ;
265
259
266
260
const handleOutsideClick = useCallback ( ( ) => {
267
261
lastFocusedElementRef . current = null ;
@@ -295,7 +289,6 @@ export const Dialog = forwardRef<HTMLDialogElement, DialogProps>(
295
289
if ( ! hasNativeDialog && dialogElement . nextSibling ) {
296
290
// use the polyfill backdrop
297
291
( dialogElement . nextSibling as HTMLDivElement ) . classList . add (
298
- classes [ 'backdrop-visible' ] ,
299
292
classes . backdrop ,
300
293
) ;
301
294
// intercept and prevent modal closing if preventClose is true
0 commit comments