-
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix:
Avatar.Image
crossorigin/referrerpolicy issues (#721)
- Loading branch information
Showing
5 changed files
with
78 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"bits-ui": patch | ||
--- | ||
|
||
fix bug preventing `crossorigin` and `referrerpolicy` attributes to work with `Avatar.Image` component |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
import { buildDocsIndex } from "$lib/scripts/build-search.js"; | ||
|
||
export function handle({ event, resolve }) { | ||
return resolve(event); | ||
export async function handle({ event, resolve }) { | ||
const response = await resolve(event); | ||
|
||
response.headers.set("Cross-Origin-Embedder-Policy", "require-corp"); | ||
response.headers.set("Cross-Origin-Opener-Policy", "same-origin"); | ||
|
||
return response; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,19 @@ | ||
<script lang="ts"> | ||
import DropdownMenuDemo from "$lib/components/demos/dropdown-menu-demo.svelte"; | ||
import { Avatar } from "bits-ui"; | ||
</script> | ||
|
||
<div class="flex items-center justify-center"> | ||
<DropdownMenuDemo /> | ||
<div class="mt-12 grid w-full justify-center gap-12"> | ||
<Avatar.Root class="h-32 w-32"> | ||
<Avatar.Image src="https://picsum.photos/200" alt="random-pic" crossorigin="anonymous" /> | ||
<Avatar.Fallback>Not loaded</Avatar.Fallback> | ||
</Avatar.Root> | ||
|
||
<Avatar.Root class="h-32 w-32"> | ||
<Avatar.Image | ||
src="https://github.com/huntabyte.png" | ||
alt="@huntabyte" | ||
crossorigin="anonymous" | ||
/> | ||
<Avatar.Fallback>Not loaded</Avatar.Fallback> | ||
</Avatar.Root> | ||
</div> |