mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-12-19 19:06:16 +01:00
fix tooltip not showing if too far left (#6909)
This commit is contained in:
parent
e640981cc4
commit
3d40ed5d47
@ -29,7 +29,7 @@ export default function Tooltip({ relativeTo, text }) {
|
|||||||
let newLeft = left - Math.round(tipWidth / 2);
|
let newLeft = left - Math.round(tipWidth / 2);
|
||||||
// too far right
|
// too far right
|
||||||
if (newLeft + tipWidth + TIP_SPACE > windowWidth - window.scrollX) {
|
if (newLeft + tipWidth + TIP_SPACE > windowWidth - window.scrollX) {
|
||||||
newLeft = left - tipWidth - TIP_SPACE;
|
newLeft = Math.max(0, left - tipWidth - TIP_SPACE);
|
||||||
newTop = top - Math.round(tipHeight / 2);
|
newTop = top - Math.round(tipHeight / 2);
|
||||||
}
|
}
|
||||||
// too far left
|
// too far left
|
||||||
|
Loading…
Reference in New Issue
Block a user