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

Text tooltip positioning issue in code block #9474

Open
1 task
OlegDev1 opened this issue Jan 1, 2025 · 0 comments
Open
1 task

Text tooltip positioning issue in code block #9474

OlegDev1 opened this issue Jan 1, 2025 · 0 comments

Comments

@OlegDev1
Copy link
Contributor

OlegDev1 commented Jan 1, 2025

What happened?

Text tooltip behaves incorrectly when selecting long text in code block. To reproduce the issue, paste long text and select all of it.

Video demonstrating the issue:

Screen.Recording.2025-01-01.at.18.54.41.mp4

Distribution version

Web (app.affine.pro)

What browsers are you seeing the problem on if you're using web version?

Chrome, Firefox

Are you self-hosting?

  • Yes

Relevant log output

No response

Anything else?

Part of the code that is responsible for the current behavior (floating-ui library is used):

autoUpdate(
initialElement,
formatQuickBarElement,
() => {
const element = getElement();
if (!element) return;
computePosition(element, formatQuickBarElement, {
placement: this._placement,
middleware: [
offset(10),
inline(),
shift({
padding: 6,
}),
],
})
.then(({ x, y }) => {
formatQuickBarElement.style.display = 'flex';
formatQuickBarElement.style.top = `${y}px`;
formatQuickBarElement.style.left = `${x}px`;
})
.catch(console.error);
},
{
// follow edgeless viewport update
animationFrame: true,
}
)

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

1 participant