-
Notifications
You must be signed in to change notification settings - Fork 698
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
[Avatar] Referrer Policy is not respected when loading the image #1616
Labels
Comments
this might be a good opportunity to remove the |
Also experiencing this issue! |
any updates? |
Unfortunately, this is still an issue. I was able to solve it with direct access (using useRef) workaround:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report
Current Behavior
If I add the
referrerPolicy
prop to the<Avatar.Image>
component like in the following snippet, nonetheless, the image gets loaded with the default referrer policy of the document.Checking the devtool's network tab, I can see the request for the image and the effective referrer policy "strict-origin-when-cross-origin" which is the default in Chrome.
Expected behavior
The referrer policy should be respected.
Reproducible example
CodeSandbox
Suggested solution
When preloading the image the referrerPolicy property should be respected as well and added to the
window.Image
instance. (Maybe there are more properties except forsrc
to be also included in the preloading)This is the place, where the referrerPolicy should be added:
primitives/packages/react/avatar/src/Avatar.tsx
Lines 138 to 140 in 8f75e5b
Additional context
Your environment
@radix-ui/react-avatar
The text was updated successfully, but these errors were encountered: