Skip to content

Commit

Permalink
fix: faulty modal spinner
Browse files Browse the repository at this point in the history
  • Loading branch information
rejetto committed Feb 24, 2024
1 parent 5088fce commit 5af5ec3
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions shared/dialogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,16 @@ function Dialog(d:DialogOptions) {
useEffect(()=>{
ref.current?.focus()
}, [])
d = { ...dialogsDefaults, ...d }
d = { closable: true, ...dialogsDefaults, ...d }
if (d.Container)
return h(d.Container, d)
return h('div', {
ref,
className: 'dialog-backdrop '+(d.className||''),
tabIndex: 0,
onKeyDown,
onClick: (ev: any) =>
ev.target === ev.currentTarget // this test will tell us if really the backdrop was clicked
onClick: (ev: any) => d.closable
&& ev.target === ev.currentTarget // this test will tell us if really the backdrop was clicked
&& closeDialog()
},
d.noFrame ? h(d.Content || 'div')
Expand All @@ -98,12 +98,11 @@ function Dialog(d:DialogOptions) {
},
...d.dialogProps,
},
d.closable || d.closable===undefined
&& h('button', {
className: 'dialog-icon dialog-closer',
onClick() { closeDialog() },
...d.closableProps,
}),
d.closable && h('button', {
className: 'dialog-icon dialog-closer',
onClick() { closeDialog() },
...d.closableProps,
}),
d.icon && h('div', {
className: 'dialog-icon dialog-type' + (typeof d.icon === 'string' ? ' dialog-icon-text' : ''),
'aria-hidden': true,
Expand Down

0 comments on commit 5af5ec3

Please sign in to comment.