这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@jamesnw
Copy link
Contributor

@jamesnw jamesnw commented Nov 14, 2025

Description

If an anchor was not found, we were falling back to 0px. Instead, we needed to allow the lookup to fail, and not provide any value. Otherwise, right: anchor(--invalid) positions it at right: 0px, when we don't want to position it at all.

Related Issue(s)

Fixes #355

Steps to test/reproduce

View /#invalid-anchor, apply the polyfill, and confirm that it does not move. The production version of the polyfill moves it to the bottom right- see http://localhost:3001/#invalid-anchor

TODO:

  • Address failing tests

@netlify
Copy link

netlify bot commented Nov 14, 2025

Deploy Preview for anchor-polyfill ready!

Name Link
🔨 Latest commit 398a7de
🔍 Latest deploy log https://app.netlify.com/projects/anchor-polyfill/deploys/6917684255dea10008fea22e
😎 Deploy Preview https://deploy-preview-360--anchor-polyfill.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Nov 14, 2025

Deploy Preview for anchor-position-wpt canceled.

Name Link
🔨 Latest commit 398a7de
🔍 Latest deploy log https://app.netlify.com/projects/anchor-position-wpt/deploys/691768429118b70008c22ad6

@jgerigmeyer jgerigmeyer removed their assignment Nov 14, 2025
@jgerigmeyer jgerigmeyer merged commit a0fdc47 into main Nov 14, 2025
14 of 17 checks passed
@jgerigmeyer jgerigmeyer deleted the invalid-fallback branch November 14, 2025 17:52
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.

[BUG] Invalid anchor-sides in anchor() compute to 0 instead of invalid

3 participants