Closed Beppe closed 2 years ago
My shortpath to acheive the result is this one, but I feel there must be something better (at the end of the "Merging overlapping tooltips" example update callback)
```
var sliderBBOx=slider.getBoundingClientRect();
tooltips.forEach(tt =>{
tt.style.transform=``;
var ttBBOx=tt.getBoundingClientRect();
var dXl=sliderBBOx.left-ttBBOx.left;
var dXr=sliderBBOx.right-ttBBOx.right;
if(dXl>0){
tt.style.transform=`translateX(${dXl+ttBBOx.width/2}px)`;
}
if(dXr<0){
tt.style.transform=`translateX(${dXr+ttBBOx.width/2}px)`;
}
})
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Is there a correct way to have tooltips to not trespass the slider size limits (0 - 100%)? I cannot find any example or SO question about it.
Use case: My slider is into a column and there is not enough padding for the toltip