-
-
Notifications
You must be signed in to change notification settings - Fork 218
Closed
Labels
FixedFixed in master branch. Pending production release.Fixed in master branch. Pending production release.bugSomething isn't workingSomething isn't working
Description
Describe the bug
Description:
The popover attribute does not have the correct type definition in SvelteKit's typings. According to the MDN documentation, the popover attribute is a boolean attribute when used without a value. When present without a value, it should default to "auto" instead of requiring an explicit value.
Example Code
This code should be valid, but TypeScript reports an error:
<button popovertarget="popover-div">Click me</button>
<div popover id="popover-div">
...
</div>Error Message
Type 'true' is not assignable to type '"" | "auto" | "manual" | null | undefined'.ts(2322)
(property) popover?: "" | "auto" | "manual" | null | undefined
Expected Behavior
- The
popoverattribute should allowpopover={true}as valid, reflecting its boolean HTML attribute behavior. - If
popoveris present without a value, it should default to"auto"rather than throwing a TypeScript error.
Suggested Fix
Update the type definition in SvelteKit’s typings to:
- Accept
true, allowingpopover={true}. - Default to
"auto"whenpopoveris used without a value.
Reproduction
<button popovertarget="popover-div">Click me</button>
<div popover id="popover-div">
...
</div>Logs
System Info
System:
OS: macOS 15.3
CPU: (11) arm64 Apple M3 Pro
Memory: 183.48 MB / 18.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.12.0 - ~/.config/.nvm/versions/node/v22.12.0/bin/node
npm: 10.9.0 - ~/.config/.nvm/versions/node/v22.12.0/bin/npm
pnpm: 9.15.2 - /opt/homebrew/bin/pnpm
Browsers:
Chrome: 133.0.6943.53
Safari: 18.3Severity
annoyance
Metadata
Metadata
Assignees
Labels
FixedFixed in master branch. Pending production release.Fixed in master branch. Pending production release.bugSomething isn't workingSomething isn't working