range.getBoundingClientRect() return 0 for all values
Hi, I'm looking for a way to get a callback on selection with selected text and coordinates of selected text. Trying to do it with latest version of v0.3 and the following code:
book.rendition.on("selected", function(cfiRange) {
book.range(cfiRange).then(function (range) {
if (range) {
var text = range.toString();
console.log(text);
var boundedRect = range.getBoundingClientRect();
console.log(boundedRect);
}
})
});
Selected text it prints correctly, but boundedRect returns with all values: 0
I've established a Plunker demo here: https://plnkr.co/edit/XlzLP3J2Pp3q53qIkHjq?p=preview Maybe somebody has a clue what gone wrong?
Having the same issue too , couldn't know why this happened , update please ? this is really limiting a use case where I wanna render something like a tooltip at the end of the selection etc... . any ideas how I could manage that if I'm running to the same issue ?
any luck on this?
#809