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

inert is not treated as a boolean attribute #12727

Closed
1 task done
JoeMorgan opened this issue Dec 12, 2024 · 1 comment
Closed
1 task done

inert is not treated as a boolean attribute #12727

JoeMorgan opened this issue Dec 12, 2024 · 1 comment
Assignees
Labels
- P2: nice to have Not breaking anything but nice to have (priority)

Comments

@JoeMorgan
Copy link
Contributor

Astro Info

Astro                    v5.0.5
Node                     v22.1.0
System                   macOS (x64)
Package Manager          npm
Output                   server
Adapter                  @astrojs/netlify
Integrations             @astrojs/solid-js
                         @astrojs/mdx
                         @astrojs/sitemap

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

No response

Describe the Bug

Same as 12023, but in this case it's the inert attribute. When resolving the inert attribute Astro preserves the full attribute with its value: inert="true" or inert="false". This causes the relevant portion of the UI to become inert (can't interact with it via keyboard or mouse) in both true and false conditions.

On v4.X, inert="true" was output when true, and nothing was when false.

inert is not part of the list of boolean attributes at: https://github.com/withastro/astro/blob/astro%405.0.0-beta.1/packages/astro/src/runtime/server/render/util.ts#L9

What's the expected result?

As per https://5-0-0-beta.docs.astro.build/en/guides/upgrade-to/v5/#changed-non-boolean-html-attribute-values, I expect the output of inert={true} should be inert, inert={false} should not output anything.

See the specification for more details concerning this attribute.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-s2pipusj?file=src%2Fcomponents%2FWelcome.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 Dec 12, 2024
@ematipico ematipico added the - P3: minor bug An edge case that only affects very specific usage (priority) label Dec 12, 2024
@github-actions github-actions bot removed the needs triage Issue needs to be triaged label Dec 12, 2024
@ematipico ematipico added - P2: nice to have Not breaking anything but nice to have (priority) needs triage Issue needs to be triaged and removed - P3: minor bug An edge case that only affects very specific usage (priority) labels Dec 12, 2024
@github-actions github-actions bot removed the needs triage Issue needs to be triaged label Dec 12, 2024
@JoeMorgan
Copy link
Contributor Author

PR here: #12729

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P2: nice to have Not breaking anything but nice to have (priority)
Projects
None yet
Development

No branches or pull requests

3 participants