Skip to content

Conversation

@distantnative
Copy link
Member

@distantnative distantnative commented Feb 25, 2023

This PR …

  • Blocks isEditing state has been global based on any open dialog/drawer
  • PR localises this state and tracks opening/closing the drawer instead

Fixes

Ready?

  • Unit tests for fixed bug/feature
  • In-code documentation (wherever needed)
  • Tests and checks all pass

For review team

@distantnative distantnative requested a review from afbora February 25, 2023 21:52
@distantnative distantnative self-assigned this Feb 25, 2023
@distantnative distantnative linked an issue Feb 25, 2023 that may be closed by this pull request
@distantnative distantnative force-pushed the fix/4282-blocks-copy-nested branch from 8f8a806 to 7751a48 Compare February 25, 2023 21:54
@afbora
Copy link
Member

afbora commented Feb 25, 2023

I don't understand the codes but it seems to work great 🙈 🎉


I just wondering the codes, not an issue. When the blocks field is opened, isEditing = true is set, but the copy() method should returns false when isEditing = true. I added console.log(this.isEditing); to the beginning of the copy() method. When I tried to copy with CTRL + C I noticed that copy() method works two times and the first one returns true and the second one returns false. But I don't understand how.

@distantnative
Copy link
Member Author

@afbora I think I know what's happening. Our Blocks.vue is listening for just copy/paste commands globally. So the 2 console entries you (and I see) aren't from the one blocks field but - at least in my case - from the two blocks field I have on the same page. Baffled that it's been like that for all the time - but likely the this.selectedOrBatched.length check always saved us from worse.

Copy link
Member

@afbora afbora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working great for me 💛

@afbora afbora requested review from a team and bastianallgeier February 27, 2023 08:22
@bastianallgeier
Copy link
Member

Do we want to add this to 3.9.2?

@afbora
Copy link
Member

afbora commented Feb 27, 2023

3.9.2 would be great if you, as the author of the blocks field, think the PR is ready. Otherwise let's move it to the next version.

@bastianallgeier bastianallgeier added this to the 3.9.2 milestone Feb 27, 2023
@distantnative distantnative merged commit 62c8366 into develop Feb 27, 2023
@distantnative distantnative deleted the fix/4282-blocks-copy-nested branch February 27, 2023 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Copy&Paste not working on nested blocks

4 participants