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

Locked (restrict editing) reusable block is still editable #40309

Closed
MarieComet opened this issue Apr 13, 2022 · 12 comments
Closed

Locked (restrict editing) reusable block is still editable #40309

MarieComet opened this issue Apr 13, 2022 · 12 comments
Labels
[Feature] Block Locking The API allowing for the ability to lock/unlock blocks [Package] Block editor /packages/block-editor [Type] Bug An existing feature does not function as intended

Comments

@MarieComet
Copy link
Contributor

Description

With WP 6.0 beta 1.
A locked reusable block (with "restrict editing") text content is still editable.
From my tests, it's happening only for blocks containing text (paragraph and list block for example).
(See video for example).

Step-by-step reproduction instructions

  1. Insert a paragraph or list block, enter some text
  2. Add it to reusable blocks
  3. Lock it (with "restrict editing" option)
  4. Click on the text, I can edit it

Screenshots, screen recording, code snippet

Démo : https://mariecomet.fr/wp-content/uploads/2022/04/locked-reusable-block.mp4

Environment info

  • WP 6.0 beta 1
  • Gutenberg plugin not active
  • Twenty Twenty-One Version: 1.5

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@Mamaduka Mamaduka added [Type] Bug An existing feature does not function as intended [Package] Block editor /packages/block-editor [Feature] Block Locking The API allowing for the ability to lock/unlock blocks labels Apr 13, 2022
@MarieComet
Copy link
Contributor Author

Note : I don't know why, the linked video doesn't load on Firefox, please use Chrome to watch it.

@Mamaduka
Copy link
Member

Thanks again, @MarieComet, for contributing.

I just tried to reproduce the issue, but I cannot select block inside Reusable block when editing is locked. Posting my env and screencast. Let me know if I'm missing something.

cc @paaljoachim

Environment

  • WP 6.0 Beta 1
  • Gutenberg plugin not active (tested with the plugin as well).
  • TT1 theme.
  • MacOS/Chrome
CleanShot.2022-04-13.at.15.41.14.mp4
@MarieComet
Copy link
Contributor Author

Yes, it's working on Chrome, can you test on Firefox ?

@MarieComet
Copy link
Contributor Author

After some tests, it's looks like removing pointer-events: none; here fix the bug :

.block-editor-block-content-overlay.overlay-active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    border-radius: 2px;
    z-index: 10;
    /* pointer-events: none; */
}
@Mamaduka
Copy link
Member

I can confirm that the overlay works in Chrome and Safari but fails with Firefox.

@paaljoachim
Copy link
Contributor

Testing.
Local site.
WP 6.0 Beta 1.
Twenty Twenty Two.

Chrome.
Overlay works. Locking works.

Firefox.
Overlay not working. First click goes straight through to inner blocks. First click should only select the overlay. Second click should go through as long as Restrict editing lock is not activated.
Activating locking Restrict editing not working.
Fix the overlay and Restrict editing might also work as it should.

Opera.
Overlay works. Locking works.

Safari
Overlay works. Locking works.

@paaljoachim paaljoachim added the Backport to WP 6.6 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Apr 13, 2022
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Apr 14, 2022
@talldan
Copy link
Contributor

talldan commented Apr 14, 2022

After some tests, it's looks like removing pointer-events: none; here fix the bug

Lets try that out. From what I can tell that also helps with #35079, though that particular issue is still broken in Safari.

I made a PR - #40339.

@talldan talldan removed the Backport to WP 6.6 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Apr 19, 2022
@talldan
Copy link
Contributor

talldan commented Apr 19, 2022

The 'Backport to WP Beta/RC' label is just for PRs, not for issues, so I've removed it.

@ndiego
Copy link
Member

ndiego commented Apr 25, 2022

Given that the "edit locking" functionality is not going to make it into 6.0 (see #40498), I am going to remove this from the 6.0 Project Board.

@Mamaduka
Copy link
Member

I'm no longer able to reproduce the issue on the current trunk. It might be related to the recent change of using the inert attribute in useDisabled. See #44865.

@Mamaduka Mamaduka removed the [Status] In Progress Tracking issues with work in progress label Oct 13, 2022
@Mamaduka
Copy link
Member

Hi, @MarieComet

Could you let me know if you can still reproduce this issue?

@MarieComet
Copy link
Contributor Author

Hi @Mamaduka,

I can't reproduce this issue 👍
Testing with WP 6.2-RC2-55551, Chrome and Firefox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block Locking The API allowing for the ability to lock/unlock blocks [Package] Block editor /packages/block-editor [Type] Bug An existing feature does not function as intended
5 participants