Currently, I am working with React and facing an issue where a span element appears whenever a user hovers over a text element. The problem is that the existing text shifts leftwards when the span appears (to the right of the text). The desired behavior is for the span to appear on the right of the text without causing any shifting effect. Is there a way to achieve this using CSS? Please refer to the code snippet below:
<TableCell
classes={{ root: classes.tableCell }}
onMouseEnter={() => this.handleMouseEnter(index)}
onMouseLeave={() => this.handleMouseLeave(index)}
align="center">
Hello
{(isHovering) && <span>{this.getTitle(movie.title)} />}
</TableCell>