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

Fix StackBlitz edit feature by selecting the closest example #36088

Merged
merged 1 commit into from
Mar 31, 2022

Conversation

julien-deramond
Copy link
Member

@julien-deramond julien-deramond commented Mar 30, 2022

Description

This PR is a proposal to fix the fact that the StackBlitz edit button creates a StackBlitz env only with the first example of the page due to event.target.closest('.bd-content') and that pages only have one .bd-content.

For example https://twbs-bootstrap.netlify.app/docs/5.1/components/accordion/#flush will create a StackBlitz env with the content of https://twbs-bootstrap.netlify.app/docs/5.1/components/accordion/#example.

I've changed the selector in order to have the closest example of the edit button (the sibling example).

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have read the contributing guidelines
  • My code follows the code style of the project (using npm run lint)
  • My change introduces changes to the documentation
  • I have updated the documentation accordingly
  • All new and existing tests passed

Related issues

N/A

Live previews

@julien-deramond
Copy link
Member Author

Before going further here I'd like a first feedback on this PR :)

I propose to tackle this topic with multiple steps:

  1. Hide all the non-working examples (for different reasons) in this PR based on this new parameter 113a173
  2. Create a tracking issue by copying the list actually in the description of this PR (that can be split in multiple sub-issues) to reintroduce progressively edit button after having found a solution

What do you think?

@GeoSot
Copy link
Member

GeoSot commented Mar 31, 2022

Nice catch @julien-deramond .

I would prefer the multiple steps approach. It is better to fix to issue first, and in another step to check which examples need to be 'fixed' or with hidden edti-btn

@julien-deramond
Copy link
Member Author

Thanks for your feedback @GeoSot. This PR now contains only the fix and #36091 contains the tracking of the examples to hide or fix + the new parameter allowing to hide one example.

@julien-deramond julien-deramond marked this pull request as ready for review March 31, 2022 10:31
@GeoSot
Copy link
Member

GeoSot commented Mar 31, 2022

Thank you to @julien-deramond . As always, fast and effective

@GeoSot GeoSot merged commit bef4f3b into twbs:main Mar 31, 2022
@julien-deramond julien-deramond deleted the main-jd-fix-stackblitz-examples branch March 31, 2022 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants