fix: faulty modal spinner
Massimo Melina committed
Feb 24, 2024 at 00:43 UTC
47c0005429578ae7aa90ea19ea304c47549093c5
1 file changed
+8
-9
shared/dialogs.ts
+8
-9
@@ -72,7 +72,7 @@ function Dialog(d:DialogOptions) {
72
useEffect(()=>{
73
ref.current?.focus()
74
}, [])
75
- d = { ...dialogsDefaults, ...d }
75
+ d = { closable: true, ...dialogsDefaults, ...d }
76
if (d.Container)
77
return h(d.Container, d)
78
return h('div', {
@@ -80,8 +80,8 @@ function Dialog(d:DialogOptions) {
80
className: 'dialog-backdrop '+(d.className||''),
81
tabIndex: 0,
82
onKeyDown,
83
- onClick: (ev: any) =>
84
- ev.target === ev.currentTarget // this test will tell us if really the backdrop was clicked
83
+ onClick: (ev: any) => d.closable
84
+ && ev.target === ev.currentTarget // this test will tell us if really the backdrop was clicked
85
&& closeDialog()
86
},
87
d.noFrame ? h(d.Content || 'div')
@@ -98,12 +98,11 @@ function Dialog(d:DialogOptions) {
98
},
99
...d.dialogProps,
100
},
101
- d.closable || d.closable===undefined
102
- && h('button', {
103
- className: 'dialog-icon dialog-closer',
104
- onClick() { closeDialog() },
105
- ...d.closableProps,
106
- }),
101
+ d.closable && h('button', {
102
+ className: 'dialog-icon dialog-closer',
103
+ onClick() { closeDialog() },
104
+ ...d.closableProps,
105
+ }),
106
d.icon && h('div', {
107
className: 'dialog-icon dialog-type' + (typeof d.icon === 'string' ? ' dialog-icon-text' : ''),
108
'aria-hidden': true,