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

[fix] Sticky text content / hovered shapes #1808

Merged
merged 3 commits into from
Aug 15, 2023
Merged

Conversation

steveruizok
Copy link
Collaborator

This PR improves the UX around sticky notes. It fixes were some bugs related to the editing / hovered shape after cloning a sticky note shape.

Change Type

  • patch — Bug fix

Test Plan

  1. Use the sticky note tool
  2. Alt-drag to clone sticky notes
  3. Use the Enter key to edit the selected shape.
  4. Double click an editable shape and then click once to edit a shape of the same type.
  • Unit Tests

@huppy-bot huppy-bot bot added the bugfix Bug fix label Aug 15, 2023
@vercel
Copy link

vercel bot commented Aug 15, 2023

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

Name Status Preview Updated (UTC)
examples ✅ Ready (Inspect) Visit Preview Aug 15, 2023 4:26pm

@steveruizok steveruizok enabled auto-merge August 15, 2023 16:24
@steveruizok steveruizok added this pull request to the merge queue Aug 15, 2023
Merged via the queue into main with commit 1dc76fe Aug 15, 2023
@steveruizok steveruizok deleted the fix-sticky-content branch August 15, 2023 16:30
github-merge-queue bot pushed a commit that referenced this pull request Jul 22, 2024
…eometry hit area (#4237)

This took a while 😵‍💫 I tried many approaches. The bug is this and
fairly specific:
- when shape is selected
- double-clicking _within_ the label geometry
- the text field is selected/focused on the first click, but then it
loses the focus on the second click

This really showed up in the retro when dragging sticky notes around and
then trying to edit them. (but it also applies to other geo shapes)

This only happens within the label geometry b/c of the extra logic we do
around that. The problem is that the label geometry is actually not the
geometry of the actual `<textarea>` and so our logic is sort of at odds
with what we're actually rendering.
I tried first making the textarea larger with CSS to match the label
geometry but this has a lot of downstream side-effects and was a bad
idea. The other thing I was trying was some special dbl-click logic but
that was also not working as intended.

Finally, I noticed that the canvas "loop" code that we have that feeds
the click back into the state machine was one of the differentiators
when following the code paths. Removing this fixes the issue and doesn't
seem to have any other side effects.

I spelunked and checked on what the previous PRs for this code and it
looks like it'll be fine. This logic has been reworked enough where we
don't need it anymore:
- #1808
- #1806

This is a followup after this focus PR:
#3718

Before:


https://github.com/user-attachments/assets/102ea9ca-9b11-4f36-973d-6cd6f9381d3d

After:


https://github.com/user-attachments/assets/40e575d8-3c1d-427e-b34f-2a30c7911c00

### Change type

- [x] `bugfix`
- [ ] `improvement`
- [ ] `feature`
- [ ] `api`
- [ ] `other`

### Release notes

- Text editing: fix dbl-click to edit text, when shape is selected, in
label geometry hit area
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant