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

Editor crashes when Post edit block selected with other blocks #2

Closed
bobbingwide opened this issue Jun 12, 2021 · 7 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@bobbingwide
Copy link
Owner

When I was attempting Call #7: Polished portfolios I experienced the Editor crashing.

I documented this at https://sneak-peek.me/2021/06/11/call-7-polished-portfolios/

The problem occurs when the Post Edit block is selected as part of multiple block selection.

3 blocks selected
image

Attempting to select the Post Edit block leads to
image

The error is

TypeError: Cannot read property 'lastChild' of null
    at np (https://sneak-peek.me/wp-content/plugins/gutenberg/build/block-editor/index.js?ver=88d0ba7a6e6f356fbb72073b72436b2a:81:22824)
    at https://sneak-peek.me/wp-content/plugins/gutenberg/build/block-editor/index.js?ver=88d0ba7a6e6f356fbb72073b72436b2a:81:23828
    at Bh (https://sneak-peek.me/wp-content/plugins/gutenberg/vendor/react-dom.min.de439aae.js:126:456)
    at Dj (https://sneak-peek.me/wp-content/plugins/gutenberg/vendor/react-dom.min.de439aae.js:162:476)
    at unstable_runWithPriority (https://sneak-peek.me/wp-content/plugins/gutenberg/vendor/react.min.e713ea3b.js:25:260)
    at Da (https://sneak-peek.me/wp-content/plugins/gutenberg/vendor/react-dom.min.de439aae.js:60:280)
    at xb (https://sneak-peek.me/wp-content/plugins/gutenberg/vendor/react-dom.min.de439aae.js:162:231)
    at Te (https://sneak-peek.me/wp-content/plugins/gutenberg/vendor/react-dom.min.de439aae.js:146:79)
    at https://sneak-peek.me/wp-content/plugins/gutenberg/vendor/react-dom.min.de439aae.js:61:68
    at unstable_runWithPriority (https://sneak-peek.me/wp-content/plugins/gutenberg/vendor/react.min.e713ea3b.js:25:260)

Note: The Post edit block is almost impossible to select in the block editor anyway.
So something needs to be changed. Maybe whatever's necessary to make the block selectable will solve the problem.
Perhaps just allowing the user to define the (Edit) string will be enough.

@bobbingwide bobbingwide added the bug Something isn't working label Jun 12, 2021
@bobbingwide bobbingwide self-assigned this Jun 13, 2021
@bobbingwide
Copy link
Owner Author

bobbingwide commented Jun 13, 2021

Proposed solution

  • Allow the (Edit) label for the link to. Be editable.
  • Add block supports values similar to the Post Date block: align, typography
  • Eliminate Server Side Rendering code when in the editor. Can the save method be removed completely?
  • Update SSR to support label and alignment settings.

@bobbingwide
Copy link
Owner Author

In this screen capture, the 3 blocks selected are:

  1. The group block containing featured image, title and post date
  2. The Post edit block
  3. The spacer that follows

The Post edit block is styled with align center, link colour white and background black.

image

@bobbingwide
Copy link
Owner Author

This is now fixed in v0.1.0.
Need to upload to sneak-peek.me and test.

@bobbingwide
Copy link
Owner Author

bobbingwide commented Jul 8, 2021

I haven't uploaded the block to sneak-peek.me. It now appears that the block doesn't work in s.b/wp55/thisis
I don't yet have a clue why not.

@bobbingwide
Copy link
Owner Author

I haven't uploaded the block to sneak-peek.me. It now appears that the block doesn't work in s.b/wp55/thisis
I don't yet have a clue why not.

I belive the problem is explained by my investigation in bobbingwide/thisis#34

Proposed solution

Apply the workaround suggested, and retest in s.b/wp55/thisis and sneak-peek.me

bobbingwide added a commit that referenced this issue Jul 13, 2021
@bobbingwide
Copy link
Owner Author

Apply the workaround suggested, and retest in s.b/wp55/thisis

I retested in https://s.b/wp55/thisis/2021/06/13/post-edit-block/, logged in and out, with and without the workaround.

@bobbingwide
Copy link
Owner Author

I retested in https://sneak-peek.me/2021/06/13/post-edit-block/
After noting that the casual visitor won't actually see the link I updated the post to include the screenshot for the plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant