Skip to content

Fix StackBlitz edit feature by selecting the closest example#36088

Merged
GeoSot merged 1 commit intotwbs:mainfrom
julien-deramond:main-jd-fix-stackblitz-examples
Mar 31, 2022
Merged

Fix StackBlitz edit feature by selecting the closest example#36088
GeoSot merged 1 commit intotwbs:mainfrom
julien-deramond:main-jd-fix-stackblitz-examples

Conversation

@julien-deramond
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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