Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blurry text in tooltip #3521

Closed
jamesrichard91 opened this issue Mar 6, 2019 · 2 comments
Closed

Blurry text in tooltip #3521

jamesrichard91 opened this issue Mar 6, 2019 · 2 comments

Comments

@jamesrichard91
Copy link

jamesrichard91 commented Mar 6, 2019

When I use the Overlay and Tooltip as shown, the text is very blurry. I have figured out that the transform that is being used to position the tooltip is causing the issue. I have attached screenshots with the before and after while editing the style in the browser inspector.

                <span
                    className="fa fa-question-circle descriptionIcon"
                    onClick={() => this.setState({ showDescription: !showDescription })}
                    ref={(icon) => {
                        this.target = icon;
                    }}
                />
                <Overlay
                    rootClose
                    placement="top"
                    show={showDescription}
                    onHide={() => this.setState({ showDescription: false })}
                    target={() => this.target}
                    container={this}
                >
                    <Tooltip id="description-tooltip">
                        {description}
                    </Tooltip>
                </Overlay>

Original:
originalblurrytooltip
originalelementstyle

Fixed:
cleartooltip
modifiedelementstyle

@taion
Copy link
Member

taion commented Mar 7, 2019

we just match the upstream in using popper here. perhaps you're looking for twbs/bootstrap#22610

@taion taion closed this as completed Mar 7, 2019
@Alpha-Dolphi
Copy link

Alpha-Dolphi commented Oct 3, 2023

I found a solution for anyone still looking for an answer. You just need to replace transform with left and top like so

if (this.state.opened) {
const ref = this.tooltipRef.current;

		const tooltip = ref.parentNode.parentNode;

		setTimeout(() => {
			const transform = tooltip.style.getPropertyValue('transform')

			const regex = /translate3d\(([^,]+),\s*([^,]+)/;
			const match = transform.match(regex);

			if (match) {
				const firstValue = match[1];
				const secondValue = match[2];

				tooltip.style.transform = "none";
				tooltip.style.left = firstValue;
				tooltip.style.top = secondValue;
			}
		}, 0)
	}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants