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

chore: Fix React :nth-child warnings #3768

Merged
merged 3 commits into from
Oct 8, 2024
Merged

Conversation

DafyddLlyr
Copy link
Contributor

@DafyddLlyr DafyddLlyr commented Oct 7, 2024

Been meaning to get around to this one for a while!

image

Comment on lines 99 to 107
// Styles for placeholder text, to match ui/Input.tsx
"& p.is-editor-empty:nth-child(1)::before": {
color: theme.palette.text.placeholder,
opacity: 1,
content: `attr(data-placeholder)`,
float: "left",
height: 0,
pointerEvents: "none",
},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed as there's no reference to the class is-editor-empty elsewhere in the codebase, I believe this is redundant.

Copy link
Contributor

Choose a reason for hiding this comment

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

@DafyddLlyr I see that there's no longer placeholder text on the Editor Model:

Screenshot 2024-10-07 at 11 05 19

Wonder if this is linked to this change being removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Aha - I missed this somehow - taking a look thanks!

Copy link
Contributor Author

@DafyddLlyr DafyddLlyr Oct 7, 2024

Choose a reason for hiding this comment

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

Fixed! Please see 3af7314

This was actually a class generated by tiptap (docs).

Comment on lines -10 to -12
"&:not(:nth-child(1))": {
paddingLeft: theme.spacing(2),
},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't see where the style applies, tried all usual tricks of solid red borders, hotpink background etc to locate when this should apply without any luck.

@DafyddLlyr DafyddLlyr marked this pull request as ready for review October 7, 2024 08:44
@DafyddLlyr DafyddLlyr requested a review from a team October 7, 2024 08:44
Copy link

github-actions bot commented Oct 7, 2024

Removed vultr server and associated DNS entries

Copy link
Contributor

@RODO94 RODO94 left a comment

Choose a reason for hiding this comment

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

Thanks for picking this up! Absolute dream.

@DafyddLlyr one question still sitting there regarding placeholder text

Comment on lines 99 to 107
// Styles for placeholder text, to match ui/Input.tsx
"& p.is-editor-empty:nth-child(1)::before": {
color: theme.palette.text.placeholder,
opacity: 1,
content: `attr(data-placeholder)`,
float: "left",
height: 0,
pointerEvents: "none",
},
Copy link
Contributor

Choose a reason for hiding this comment

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

@DafyddLlyr I see that there's no longer placeholder text on the Editor Model:

Screenshot 2024-10-07 at 11 05 19

Wonder if this is linked to this change being removed?

@DafyddLlyr DafyddLlyr marked this pull request as draft October 7, 2024 12:41
@DafyddLlyr DafyddLlyr requested a review from a team October 7, 2024 16:37
@DafyddLlyr DafyddLlyr marked this pull request as ready for review October 7, 2024 16:37
Copy link
Contributor

@RODO94 RODO94 left a comment

Choose a reason for hiding this comment

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

Just one wee commented out line that I picked up but all looks good otherwise and everything still works for me

@@ -97,7 +97,8 @@ export const RichContentContainer = styled(Box)(({ theme }) => ({
},
},
// Styles for placeholder text, to match ui/Input.tsx
"& p.is-editor-empty:nth-child(1)::before": {
// "& p.is-editor-empty:nth-child(1)::before": {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: lingering comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hahah sorry - very good catch thank you 😅

Fixed in a0b896b

@DafyddLlyr DafyddLlyr merged commit 3262ef8 into main Oct 8, 2024
10 checks passed
@DafyddLlyr DafyddLlyr deleted the dp/fix-nth-child-warning branch October 8, 2024 09:21
DafyddLlyr added a commit that referenced this pull request Oct 8, 2024
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.

2 participants