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

Video Block: Fix TypeError when removing poster. #34411

Merged
merged 1 commit into from
Sep 1, 2021

Conversation

getsource
Copy link
Member

Description

While working on #21553, I noticed that removing a poster image from a video currently results in a TypeError:

Uncaught TypeError: this is undefined
    onRemovePoster edit.js:157

This PR removes a this reference, I'm guessing left over from the hooks conversion, fixing the TypeError.

Props @Mamaduka for recommending the fix.

How has this been tested?

  • Add Video Block
  • Select Video
  • Select Poster
  • Remove Poster
  • Notice that there is no longer a TypeError

Screenshots

Types of changes

Bug fix

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).

@getsource getsource added [Type] Bug An existing feature does not function as intended [Block] Video Affects the Video Block labels Aug 31, 2021
@getsource getsource requested a review from ajitbohra as a code owner August 31, 2021 10:43
@getsource getsource force-pushed the fix/remove-poster-typeerror branch from 2723266 to 199044f Compare September 1, 2021 02:43
Copy link
Contributor

@ntsekouras ntsekouras left a comment

Choose a reason for hiding this comment

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

Thanks! 👍

@ntsekouras ntsekouras merged commit 412b015 into WordPress:trunk Sep 1, 2021
@github-actions github-actions bot added this to the Gutenberg 11.5 milestone Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Video Affects the Video Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants