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

Use floating-ui to position text toolbar #467

Merged
merged 7 commits into from
Nov 19, 2022
Merged

Conversation

TrySound
Copy link
Member

Ref #107

Text toolbar is badly positioned when flipped up. Keeping it too close to cursor makes text selection harder.

Here I replaced custom logic with computed rect from toolbar parent and state from canvas. A few middlewares polished offsets. Flip no longer overlap text.

Also fixed toolbar background.

Before requesting a review

  • if the PR is WIP - use draft mode
  • [xx] made a self-review
  • added inline comments where things may be not obvious (the "why", not "what")
  • what kind of review is needed?
    • conceptual
    • detailed
    • with testing

Test cases

  • step by step interaction description and what is expected to happen

Before merging

  • tested locally and on preview environment (preview dev login: 5de6)
  • updated test cases document
  • added tests
  • if any new env variables are added, added them to .env.example and the designer/env-check.js if mandatory

Ref #107

Text toolbar is badly positioned when flipped up. Keeping it too close
to cursor makes text selection harder.

Here I replaced custom logic with computed rect from toolbar parent and
state from canvas. A few middlewares polished offsets. Flip no longer
overlap text.

Also fixed toolbar background.
@vercel
Copy link

vercel bot commented Nov 18, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
webstudio-designer ✅ Ready (Inspect) Visit Preview Nov 19, 2022 at 7:26AM (UTC)

@TrySound TrySound merged commit b163fdf into main Nov 19, 2022
@TrySound TrySound deleted the text-toolbar-floating-ui branch November 19, 2022 07:51
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

Successfully merging this pull request may close these issues.

None yet

3 participants