fix: image preview (#2818)

This commit is contained in:
danielchim
2023-06-27 15:26:57 +08:00
committed by GitHub
parent 10c7f93a85
commit 4307e1eb6b
7 changed files with 537 additions and 419 deletions

View File

@@ -67,7 +67,7 @@ export const toast = (
duration: 2500,
}
) => {
if (!ToastContainer) {
if (!ToastContainer || (portal && !portal.contains(ToastContainer))) {
ToastContainer = createToastContainer(portal);
}
@@ -126,6 +126,7 @@ export const toast = (
element.style.margin = '0';
element.style.padding = '0';
// wait for transition
// ToastContainer = null;
element.addEventListener('transitionend', () => {
element.remove();
});

View File

@@ -11,6 +11,8 @@ const StyledTooltip = styled(StyledPopperContainer)(() => {
backgroundColor: 'var(--affine-tooltip)',
color: 'var(--affine-white)',
fontSize: 'var(--affine-font-sm)',
borderRadius: '8px',
marginBottom: '12px',
};
});