Skip to content

Fix instanceof failed on iframe editor#54643

Closed
bangank36 wants to merge 1 commit intoWordPress:trunkfrom
bangank36:fix/iframe-blocks-event
Closed

Fix instanceof failed on iframe editor#54643
bangank36 wants to merge 1 commit intoWordPress:trunkfrom
bangank36:fix/iframe-blocks-event

Conversation

@bangank36
Copy link
Contributor

@bangank36 bangank36 commented Sep 20, 2023

What?

Address #54378

Why?

Since blocks are rendered inside iframe, which has its own environment with its own globals, the check

if ( ! ( event.target instanceof HTMLInputElement ) ) {

will be against the parent window not the iframe, thus it returns false and stop the Time inputs to fire properly

How?

TBA

Testing Instructions

For quick testing purpose, the Time component is included in ButtonEdit

  • Add a Button
  • Modify the Time inputs
  • Watch the value changes upon onChange

Testing Instructions for Keyboard

Screenshots or screencast

Kapture.2023-09-20.at.11.05.14.mp4

cc: @ciampo @Honkitonkie

@bangank36
Copy link
Contributor Author

Closed in favor of #54669

@bangank36 bangank36 closed this Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant