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

6998: fix for the pseudo class ":first-child" is potentially unsafe #7000

Closed
wants to merge 2 commits into from
Closed

6998: fix for the pseudo class ":first-child" is potentially unsafe #7000

wants to merge 2 commits into from

Conversation

yasharzolmajdi
Copy link

changed ':first-child' to ':first-of-type' in tabs

Issue: #6998

What I did

changed the pseudo class for tabs from ':first-child' to ':first-of-type'

How to test

Check to see if any error is present in development console.

changed ':first-child' to ':first-of-type' in tabs
@vercel
Copy link

vercel bot commented Jun 7, 2019

This pull request is automatically deployed with Now.
To access deployments, click Details below or on the icon next to each push.

Latest deployment for this branch: https://monorepo-git-fork-yasharzolmajdi-6998-pseudo-class-fix.storybook.now.sh

@shilman shilman added bug ui patch:yes Bugfix & documentation PR that need to be picked to main branch labels Jun 7, 2019
@shilman shilman added this to the 5.1.x milestone Jun 7, 2019
@shilman
Copy link
Member

shilman commented Jun 7, 2019

Thanks so much for fixing this! Do you mind updating the snapshots?

yarn test --core --update

@yasharzolmajdi
Copy link
Author

@shilman sure, they are updated now

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

LGTM!!! 🙇

@ndelangen
Copy link
Member

the problem with first-of-type is that if you have

<div>
  <span/>
  <i/>
  <b/>
</div>

All 3 inner elements match first-of-type.

first-child only matches the first element.

It's totally different.

Though we can try to make a concerted effort to make them do the same by making sure all element in the container are of the same type:

<div>
  <span/>
  <span/>
  <span/>
</div>

this is actually incredibly hard to enforce when things like Fragments, and render-props come into play.

Since we're not using SSR and have no plans to do so, I'd rather be able to turn off this warning tbh.

@stale
Copy link

stale bot commented Jun 28, 2019

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Jun 28, 2019
@stale
Copy link

stale bot commented Jul 28, 2019

Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!

@stale stale bot closed this Jul 28, 2019
@shilman shilman removed the patch:yes Bugfix & documentation PR that need to be picked to main branch label Jan 16, 2020
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.

None yet

3 participants