Skip to content

Commit

Permalink
Merge pull request #24 from masuP9/fix/reposition-alt-editor2
Browse files Browse the repository at this point in the history
Fix/reposition alt editor2
  • Loading branch information
masuP9 authored May 9, 2021
2 parents cbaa076 + efcc7e3 commit 386920f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 31 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
},
"resolutions": {
"@types/react": "17.0.3",
"@types/react-dom": "17.0.3"
"@types/react-dom": "17.0.3",
"kind-of": "^6.0.3"
}
}
6 changes: 4 additions & 2 deletions src/scripts/components/AltEditor/AltEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ export const AltEditor: React.VFC<Props> = ({ selectedImage, onClose, ...rest })
() =>
new ResizeObserver((records) => {
records.forEach((entry) => {
const { contentRect } = entry;
setPosition(contentRect);
const { target } = entry;
if (target instanceof HTMLImageElement) {
setPosition(getPositionFromImage(target));
}
});
}),
[],
Expand Down
32 changes: 4 additions & 28 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3255,11 +3255,6 @@ is-boolean-object@^1.1.0:
dependencies:
call-bind "^1.0.0"

is-buffer@^1.1.5:
version "1.1.6"
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==

is-callable@^1.1.4:
version "1.1.5"
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.5.tgz#f7e46b596890456db74e7f6e976cb3273d06faab"
Expand Down Expand Up @@ -3559,29 +3554,10 @@ json5@^2.1.2:
array-includes "^3.1.2"
object.assign "^4.1.2"

kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0:
version "3.2.2"
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64"
integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=
dependencies:
is-buffer "^1.1.5"

kind-of@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57"
integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc=
dependencies:
is-buffer "^1.1.5"

kind-of@^5.0.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d"
integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==

kind-of@^6.0.0, kind-of@^6.0.2:
version "6.0.2"
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051"
integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==
kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0, kind-of@^4.0.0, kind-of@^5.0.0, kind-of@^6.0.0, kind-of@^6.0.2, kind-of@^6.0.3:
version "6.0.3"
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd"
integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==

levn@^0.4.1:
version "0.4.1"
Expand Down

0 comments on commit 386920f

Please sign in to comment.