Skip to content

Commit 8432e23

Browse files
committed
Merge branch 'finder' of github.com:django-cms/django-filer into finder
2 parents da65cba + 57f11e5 commit 8432e23

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

client/browser/FinderFileSelect.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, {useEffect, useRef, useState} from 'react';
22
import FileSelectDialog from './FileSelectDialog';
3+
import {useMutationObserver} from '../common/MutationObserver';
34

45

56
export default function FinderFileSelect(props) {

client/common/MutationObserver.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import {useEffect, RefObject} from 'react';
2+
3+
4+
export function useMutationObserver(ref: RefObject<Element>, callback: MutationCallback, options: MutationObserverInit) {
5+
useEffect(() => {
6+
if (ref.current) {
7+
const observer = new MutationObserver(callback);
8+
observer.observe(ref.current, options);
9+
return () => observer.disconnect();
10+
}
11+
}, [ref]);
12+
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"bootstrap": "^5.3.3",
1818
"concurrently": "^8.2.0",
1919
"downshift": "^9.0.8",
20-
"esbuild": "^0.25.0",
21-
"esbuild-plugin-svgr": "^2.1.0",
20+
"esbuild": "^0.25.5",
21+
"esbuild-plugin-svgr": "^3.1.1",
2222
"react-image-crop": "^11.0.7",
2323
"react-intersection-observer": "^9.13.1",
2424
"react-player": "^2.16.0",

0 commit comments

Comments
 (0)