Fix updatePosition uncaught error

Signed-off-by: HichamELBSI <elabbassih@gmail.com>
This commit is contained in:
HichamELBSI 2020-12-07 17:17:49 +01:00
parent 02e6f77ac3
commit f814f8e2ed

View File

@ -56,7 +56,13 @@ const RelationPreviewTooltip = ({ tooltipId, rowId, mainField, name }) => {
// Used to update the position after the loader
useLayoutEffect(() => {
if (!isLoading && tooltipRef.current) {
// A react-tooltip uncaught error is triggered when updatePosition is called in firefox.
// https://github.com/wwayne/react-tooltip/issues/619
try {
tooltipRef.current.updatePosition();
} catch (err) {
console.log(err);
}
}
}, [isLoading]);