Skip to content

Commit

Permalink
fix: OPTIC-719: TypeError: e.target.className.includes is not a funct…
Browse files Browse the repository at this point in the history
…ion (#5847)

Error coming from Sentry 
https://heartex.sentry.io/issues/5039994894/

There is no impact on the user.

This happens when a user drags and drops, for example, when the column
header is an SVG. I confirm that the drag-and-drop feature continues to
work well.

Also, `?` wont work because in the case of failure is an image that is
an svg and className is a `SVGAnimatedString` object. No need to pursue
baseVal since we don't have the className `handle`

---------

Co-authored-by: Raul Martin <raul@humansignal.com>
Co-authored-by: hlomzik <hlomzik@gmail.com>
Co-authored-by: robot-ci-heartex <robot-ci-heartex@users.noreply.github.com>
  • Loading branch information
4 people committed May 20, 2024
1 parent c7b4b98 commit 8efbfac
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 16 deletions.
8 changes: 4 additions & 4 deletions web/dist/apps/labelstudio/version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"message": "fix: LEAP-1049: support loading TimeSeries URL from sub-property of data (#5610)",
"commit": "d8819c35df0430a6adf646faa99b73e6f5df3f4f",
"date": "2024-05-14T19:41:41.000Z",
"branch": "fb-LEAP-1049/harrymander-fix-for-timeseries-urls"
"message": "add comment",
"commit": "d14113cce25e4bd294a7c4a8c57917ab06a923e0",
"date": "2024-05-08T15:50:58.000Z",
"branch": "fb-optic-719/typeerror"
}
2 changes: 1 addition & 1 deletion web/dist/libs/datamanager/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/dist/libs/datamanager/main.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions web/dist/libs/datamanager/version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"message": "fix: LEAP-1049: support loading TimeSeries URL from sub-property of data (#5610)",
"commit": "d8819c35df0430a6adf646faa99b73e6f5df3f4f",
"date": "2024-05-14T19:41:41.000Z",
"branch": "fb-LEAP-1049/harrymander-fix-for-timeseries-urls"
"message": "add comment",
"commit": "d14113cce25e4bd294a7c4a8c57917ab06a923e0",
"date": "2024-05-08T15:50:58.000Z",
"branch": "fb-optic-719/typeerror"
}
8 changes: 4 additions & 4 deletions web/dist/libs/editor/version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"message": "fix: LEAP-1049: support loading TimeSeries URL from sub-property of data (#5610)",
"commit": "d8819c35df0430a6adf646faa99b73e6f5df3f4f",
"date": "2024-05-14T19:41:41.000Z",
"branch": "fb-LEAP-1049/harrymander-fix-for-timeseries-urls"
"message": "add comment",
"commit": "d14113cce25e4bd294a7c4a8c57917ab06a923e0",
"date": "2024-05-08T15:50:58.000Z",
"branch": "fb-optic-719/typeerror"
}
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,12 @@ export const TableHead = observer(

useEffect(() => {
ref.current?.addEventListener("mousedown", (event) => {
if (event.target.className.includes("handle")) event.preventDefault();
const className = event.target.className;

// This element could be an SVG element where className is an object, not a string.
if (className?.includes?.("handle")) {
event.preventDefault();
}
});
}, []);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,12 @@ export const TableHead = observer(

useEffect(() => {
ref.current?.addEventListener("mousedown", (event) => {
if (event.target.className.includes("handle")) event.preventDefault();
const className = event.target.className;

// This element could be an SVG element where className is an object, not a string.
if (className?.includes?.("handle")) {
event.preventDefault();
}
});
}, []);

Expand Down

0 comments on commit 8efbfac

Please sign in to comment.