fix: codesanbox bug (#2842)
This commit is contained in:
parent
dd892f5bae
commit
dc97149164
@ -202,15 +202,13 @@ const PreviewerActions: typeof DumiPreviewerActions = (props) => {
|
||||
|
||||
useEffect(() => {
|
||||
if (div.current) {
|
||||
const elements = div.current.querySelectorAll('.dumi-default-previewer-actions');
|
||||
elements.forEach((element) => {
|
||||
element.addEventListener('click', (e) => {
|
||||
e.stopImmediatePropagation();
|
||||
setLoading(true);
|
||||
openCodeSandbox(props).finally(() => {
|
||||
setLoading(false);
|
||||
});
|
||||
})
|
||||
const element = div.current.querySelector('.dumi-default-previewer-action-btn');
|
||||
element?.addEventListener('click', (e) => {
|
||||
e.stopImmediatePropagation();
|
||||
setLoading(true);
|
||||
openCodeSandbox(props).finally(() => {
|
||||
setLoading(false);
|
||||
});
|
||||
})
|
||||
}
|
||||
}, [div])
|
||||
|
@ -202,15 +202,13 @@ const PreviewerActions: typeof DumiPreviewerActions = (props) => {
|
||||
|
||||
useEffect(() => {
|
||||
if (div.current) {
|
||||
const elements = div.current.querySelectorAll('.dumi-default-previewer-actions');
|
||||
elements.forEach((element) => {
|
||||
element.addEventListener('click', (e) => {
|
||||
e.stopImmediatePropagation();
|
||||
setLoading(true);
|
||||
openCodeSandbox(props).finally(() => {
|
||||
setLoading(false);
|
||||
});
|
||||
})
|
||||
const element = div.current.querySelector('.dumi-default-previewer-action-btn');
|
||||
element?.addEventListener('click', (e) => {
|
||||
e.stopImmediatePropagation();
|
||||
setLoading(true);
|
||||
openCodeSandbox(props).finally(() => {
|
||||
setLoading(false);
|
||||
});
|
||||
})
|
||||
}
|
||||
}, [div])
|
||||
|
Loading…
Reference in New Issue
Block a user