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

Property with nullish value in inline style should be omitted #8933

Closed
1 task done
MarvinXu opened this issue Oct 27, 2023 · 2 comments · Fixed by #8940
Closed
1 task done

Property with nullish value in inline style should be omitted #8933

MarvinXu opened this issue Oct 27, 2023 · 2 comments · Fixed by #8940
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority) help wanted Please help with this issue!

Comments

@MarvinXu
Copy link
Contributor

Astro Info

Astro                    v3.4.0
Node                     v18.18.0
System                   Linux (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

In JSX, <div style={{ backgroundColor: condition ? '#d6f9dd' : undefined }} /> will not produce any style. But is astro template, this will produce style="background-color:undefined"

What's the expected result?

behave as convention in JSX

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-47zegu?file=src%2Fpages%2Findex.astro

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Oct 27, 2023
@matthewp matthewp added - P4: important Violate documented behavior or significantly impacts performance (priority) and removed needs triage Issue needs to be triaged labels Oct 27, 2023
@matthewp
Copy link
Contributor

This is probably a pretty simple thing to fix once you find the code where this happens (I don't remember off-hand).

@natemoo-re natemoo-re added the help wanted Please help with this issue! label Oct 27, 2023
@MarvinXu
Copy link
Contributor Author

I'll fix this by the end of the week. It would be great if anyone remember where the code is and inform me 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority) help wanted Please help with this issue!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants