Skip to content

Images and embeds do not work #7707

Closed

Description

@tofumatt

Describe the bug
Image and embed blocks added to the page will cause an error and the following browser console output TypeError: "this.props.forwardedRef is not a function"

To Reproduce
Steps to reproduce the behavior:

  1. Edit a post or create a new post
  2. Add an image block
  3. Select an element from the media library
  4. See error

Expected behavior
You see the image.

Screenshots
2018-07-04 15 08 05

Happens on master.

Activity

  1. added
    [Priority] HighUsed to indicate top priority items that need quick attention
    on Jul 4, 2018
  2. added this to the 3.2 milestone on Jul 4, 2018
  3. self-assigned this
    on Jul 4, 2018
  4. tofumatt commented on Jul 4, 2018

    @tofumatt
    MemberAuthor

    (Worried that e2e tests didn't catch this one 😓)

  5. tofumatt commented on Jul 4, 2018

    @tofumatt
    MemberAuthor

    8b21632 is the problem commit says git bisect

  6. tofumatt commented on Jul 4, 2018

    @tofumatt
    MemberAuthor

    Going back to the check for this.props.forwardRef used in #6261 (comment) "fixes" it, which indicates the ref forwarding isn't working or as @aduth mentioned in Slack might not be working when no refs are assigned to be forwarded...

  7. nerrad commented on Jul 4, 2018

    @nerrad
    Contributor

    Ya the issue here is that there is probably something else using withGlobalEvents that is not setting a ref which gets forwarded. So there must be a check to see if there is a forwarded ref before acting on it. Definitely the solution is to add back in the if ( this.props.forwardedRef ) check in handleRef.

  8. tofumatt commented on Jul 4, 2018

    @tofumatt
    MemberAuthor

    Yeah after running through the code that still seems to be the best option, and I can't see it breaking anything. Patch incoming...

  9. added a commit that references this issue on Jul 4, 2018
    5247400
  10. added a commit that references this issue on Jul 4, 2018
    6bf9832
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

[Priority] HighUsed to indicate top priority items that need quick attention

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions