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