mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-11 20:08:37 +00:00
fix: add prefer-dom-node-append rule (#5108)
This commit is contained in:
@@ -12,7 +12,7 @@ export const RootBlockHub = () => {
|
||||
if (div.hasChildNodes()) {
|
||||
div.removeChild(div.firstChild as ChildNode);
|
||||
}
|
||||
div.appendChild(blockHub);
|
||||
div.append(blockHub);
|
||||
}
|
||||
}
|
||||
}, [blockHub]);
|
||||
|
||||
@@ -134,7 +134,7 @@ const BlockSuiteEditorImpl = ({
|
||||
if (!container) {
|
||||
return;
|
||||
}
|
||||
container.appendChild(editor);
|
||||
container.append(editor);
|
||||
return () => {
|
||||
container.removeChild(editor);
|
||||
};
|
||||
|
||||
@@ -84,7 +84,7 @@ export const playCheckAnimation = async (refElement: Element) => {
|
||||
border-radius: 50%;
|
||||
font-size: inherit;
|
||||
`;
|
||||
refElement.appendChild(sparkingEl);
|
||||
refElement.append(sparkingEl);
|
||||
|
||||
await sparkingEl.animate(
|
||||
[
|
||||
|
||||
@@ -46,7 +46,7 @@ const createToastContainer = (portal?: HTMLElement) => {
|
||||
data-testid="affine-toast-container"
|
||||
></div>`;
|
||||
const element = htmlToElement<HTMLDivElement>(template);
|
||||
portal.appendChild(element);
|
||||
portal.append(element);
|
||||
return element;
|
||||
};
|
||||
|
||||
@@ -98,7 +98,7 @@ const createAndShowNewToast = (
|
||||
const toastElement = htmlToElement<HTMLDivElement>(toastTemplate);
|
||||
// message is not trusted
|
||||
toastElement.textContent = message;
|
||||
ToastContainer.appendChild(toastElement);
|
||||
ToastContainer.append(toastElement);
|
||||
logger.debug(`toast with message: "${message}"`);
|
||||
window.dispatchEvent(
|
||||
new CustomEvent('affine-toast:emit', { detail: message })
|
||||
|
||||
Reference in New Issue
Block a user