Skip to content

Enhance sandbox component to accept sandbox prop #69617

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

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

Imran92
Copy link
Contributor

@Imran92 Imran92 commented Mar 19, 2025

What?

Enhances the Sandbox component

Why?

The iFrame in the sandbox component does not have allow-popups in its sandbox value. Because of this, when we show any content inside the sandbox that has a link, does not take users anywhere when they click on it, because it gets blocked.

Instead of hard-coding the sandbox value, we've just made it configurable, and it's optional. So it will not disrupt any place it's being used in.

Our actual goal is to use it in the Jetpack repo to fix the VP blocks. Jetpack consumes the NPM library @wordpress/components. So we'll need to release it on NPM before moving on with the next part of the fix.

How?

Testing Instructions

  1. Check the code and tests
  2. Make sure any block or anywhere else it's being used in doesn't break
  3. You can try by creating a simple consumer for this component and pass in the "sandbox" property with different valid configuration value to make sure it works.

Testing Instructions for Keyboard

N/A

Screenshots or screencast

N/A

@Imran92 Imran92 requested a review from ajitbohra as a code owner March 19, 2025 02:34
Copy link

github-actions bot commented Mar 19, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Imran92 <imranh920@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@Mamaduka Mamaduka added [Type] Enhancement A suggestion for improvement. [Feature] UI Components Impacts or related to the UI component system labels Mar 19, 2025
@Mamaduka
Copy link
Member

Thanks, @Imran92!

The https://github.com/Automattic/videopress/issues/1217 link leads to 404 packages. Please don't use private links or dead links for other repositories as references.

@t-hamano t-hamano added the [Package] Components /packages/components label Mar 19, 2025
@Imran92
Copy link
Contributor Author

Imran92 commented Mar 19, 2025

Thanks @Mamaduka , I've removed the links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] UI Components Impacts or related to the UI component system [Package] Components /packages/components [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants