Fix issue with chrome v83

roadmap/devops
Kamran Ahmed 1 year ago
parent 044046e044
commit 980e243124
  1. 4
      src/components/CreateTeam/UpdateTeamResourceModal.tsx
  2. 4
      src/components/FrameRenderer/renderer.ts
  3. 4
      src/components/TeamProgress/MemberProgressModal.tsx
  4. 8
      src/lib/dom.ts

@ -8,6 +8,7 @@ import { useOutsideClick } from '../../hooks/use-outside-click';
import { useKeydown } from '../../hooks/use-keydown'; import { useKeydown } from '../../hooks/use-keydown';
import type { TeamResourceConfig } from './RoadmapSelector'; import type { TeamResourceConfig } from './RoadmapSelector';
import { useToast } from '../../hooks/use-toast'; import { useToast } from '../../hooks/use-toast';
import {replaceChildren} from "../../lib/dom.ts";
export type ProgressMapProps = { export type ProgressMapProps = {
teamId: string; teamId: string;
@ -81,7 +82,8 @@ export function UpdateTeamResourceModal(props: ProgressMapProps) {
fontURL: '/fonts/balsamiq.woff2', fontURL: '/fonts/balsamiq.woff2',
}); });
containerEl.current?.replaceChildren(svg); replaceChildren(containerEl.current!, svg);
// containerEl.current?.replaceChildren(svg);
// Render team configuration // Render team configuration
removedItems.forEach((topicId: string) => { removedItems.forEach((topicId: string) => {

@ -10,6 +10,7 @@ import {
import type { ResourceProgressType, ResourceType } from '../../lib/resource-progress'; import type { ResourceProgressType, ResourceType } from '../../lib/resource-progress';
import { pageProgressMessage } from '../../stores/page'; import { pageProgressMessage } from '../../stores/page';
import { showLoginPopup } from '../../lib/popup'; import { showLoginPopup } from '../../lib/popup';
import {replaceChildren} from "../../lib/dom.ts";
export class Renderer { export class Renderer {
resourceId: string; resourceId: string;
@ -88,7 +89,8 @@ export class Renderer {
}); });
}) })
.then((svg) => { .then((svg) => {
this.containerEl?.replaceChildren(svg); replaceChildren(this.containerEl!, svg);
// this.containerEl?.replaceChildren(svg);
}) })
.then(() => { .then(() => {
return renderResourceProgress( return renderResourceProgress(

@ -17,6 +17,7 @@ import { useToast } from '../../hooks/use-toast';
import { useAuth } from '../../hooks/use-auth'; import { useAuth } from '../../hooks/use-auth';
import { pageProgressMessage } from '../../stores/page'; import { pageProgressMessage } from '../../stores/page';
import { MemberProgressModalHeader } from './MemberProgressModalHeader'; import { MemberProgressModalHeader } from './MemberProgressModalHeader';
import {replaceChildren} from "../../lib/dom.ts";
export type ProgressMapProps = { export type ProgressMapProps = {
member: TeamMember; member: TeamMember;
@ -91,7 +92,8 @@ export function MemberProgressModal(props: ProgressMapProps) {
fontURL: '/fonts/balsamiq.woff2', fontURL: '/fonts/balsamiq.woff2',
}); });
containerEl.current?.replaceChildren(svg); replaceChildren(containerEl.current!, svg);
// containerEl.current?.replaceChildren(svg);
} }
useKeydown('Escape', () => { useKeydown('Escape', () => {

@ -0,0 +1,8 @@
export function replaceChildren(parentNode: Element, newChild: Element) {
if (parentNode.replaceChildren) {
return parentNode.replaceChildren(newChild);
}
parentNode.innerHTML = '';
parentNode.append(newChild);
}
Loading…
Cancel
Save